Open kr-matthews opened 3 weeks ago
I'm not sure how to fix this. The TimeField
(the input) has a draftInput
value which isn't passed on to the actual value until the input is blurred (because you might want to type 60000 for 6:00.00, but after the first 4 keys the input is 6000 which can't be parsed to a valid time). Pressing enter submits the modal, which causes the time field to be removed before it has a chance to use the draft input value.
Disabling enter (by removing the onSubmit
from the modal and adding the handling to the modal button instead) would prevent people from accidentally losing the value they typed, but would be annoying - and this modal is used elsewhere too so that might have other consequences.
Describe the bug When editing a cutoff in a competition's edit events form, typing a time followed by enter will ignore the time and close the modal with the old value still in use (0 if there was no old value).
To Reproduce Steps to reproduce the behavior:
Expected behavior Enter should use the time and close the modal.
Additional Context There are a lot of modals on this page, make sure they all work properly when typing enter in any input.