Reproduction example
https://codesandbox.io/s/userevent-keyboard-prevent-imf9hv?file=/src/App.test.js
Prerequisites
- Render
<button>
- Add an event handler that calls
event.preventDefault() on the last of multiple keydown.
- Press space bar
Expected behavior
A click event is dispatched if there is any keydown without a call to event.preventDefault().
Actual behavior
The click event is only dispatched if the last keydown does not prevent default.
User-event version
14.3.0
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response
Reproduction example
https://codesandbox.io/s/userevent-keyboard-prevent-imf9hv?file=/src/App.test.js
Prerequisites
<button>event.preventDefault()on the last of multiplekeydown.Expected behavior
A
clickevent is dispatched if there is anykeydownwithout a call toevent.preventDefault().Actual behavior
The
clickevent is only dispatched if the lastkeydowndoes not prevent default.User-event version
14.3.0
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response