preventDefault() in "beforeinput" doesn't prevent "input" and "change" events when using arrow keys or clicking the spin up/down buttons
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: whimboo, Unassigned)
References
Details
Attachments
(1 file)
703 bytes,
text/html
|
Details |
On bug 1918049 I'm fixing the input event tests for input fields of type number. While doing so I noticed that the following tests are still failing. This happens because the use of preventDefault
in the beforeinput
handler doesn't stop us from emitting the input
and change
events, as well as incrementing or decrementing the actual displayed number.
- testing/web-platform/tests/input-events/input-events-arrow-key-on-number-input-prevent-default.html
- testing/web-platform/tests/input-events/input-events-spin-button-click-on-number-input-prevent-default.html
Using Chrome it works but as Olli pointed out this is most likely a recent change which we didn't follow-up on yet.
Steps to reproduce:
- Open the attached testcase
- Focus the input field
- Press the arrow up or down key
- Click the up/down spin button
For both steps 3 and 4 we emit all the events and also update the number accordingly. This should not happen given that preventDefault
in beforeinput
should actually prevent any update.
Updated•5 months ago
|
Comment 1•5 months ago
|
||
Hi Masayuki,
Chrome changes this behavior recently and added the new test cases. Is this something we should/could put into your queue to fix?
Comment 2•5 months ago
|
||
Yeah, but currently my queue is full, but it seems that this is not so important since beforeinput
event listeners usually don't close the window and redundant change event may be okay. Let's go back when I'm available.
Description
•