Commit d6cad45c authored by Taddeüs Kroes's avatar Taddeüs Kroes

Fix number tab navigation in Chrome on Android

parent abf688b3
...@@ -88,6 +88,19 @@ if table.classList.contains 'match-editable' ...@@ -88,6 +88,19 @@ if table.classList.contains 'match-editable'
localStorage.removeItem 'hide-total-scores' localStorage.removeItem 'hide-total-scores'
render 0 render 0
# cancel form submission on Enter press, go to the next input field instead
form = table.parentNode
submit_button = form.querySelector('button[type=submit]')
nextelems = new WeakMap()
nextelems.set input, inputs[(i + 1) % inputs.length] for input, i in inputs
nextelems.set inputs[inputs.length - 1], submit_button
table.addEventListener 'keypress', (e) ->
if e.key == 'Enter'
nextelems.get(e.srcElement).focus()
e.preventDefault()
# notes area grows automatically with each added line # notes area grows automatically with each added line
if notes = document.getElementById('notes') if notes = document.getElementById('notes')
cb = -> cb = ->
...@@ -114,4 +127,3 @@ toggle_color.addEventListener 'click', -> ...@@ -114,4 +127,3 @@ toggle_color.addEventListener 'click', ->
else else
localStorage.removeItem 'colored-scores' localStorage.removeItem 'colored-scores'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment