Skip to content
Snippets Groups Projects
Commit d6cad45c authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Fix number tab navigation in Chrome on Android

parent abf688b3
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,19 @@ if table.classList.contains 'match-editable'
localStorage.removeItem 'hide-total-scores'
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
if notes = document.getElementById('notes')
cb = ->
......@@ -114,4 +127,3 @@ toggle_color.addEventListener 'click', ->
else
localStorage.removeItem 'colored-scores'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment