-
Notifications
You must be signed in to change notification settings - Fork 254
Description
Reproduction example
https://codesandbox.io/p/sandbox/crazy-shape-j8gs37
Prerequisites
userEvent.type(input, "hello")userEvent.tab()
No change event appears to be fired.
Expected behavior
When a user types something into an input on the browser and tabs away (or otherwise blurs the input), the input will fire a change event if the value is different. But when this is simulated via @testing-library/user-event, this does not happen. Note that we're talking about the browser's actual change event and not the synthetic one that React creates around input events.
Actual behavior
No change event is fired.
User-event version
14.6.1
Environment
Testing Library framework: @testing-library/[email protected]
JS framework: N/A
Test environment: [email protected]
DOM implementation: [email protected]
Additional context
As a workaround, we can manually dispatch a change event / use fireEvent.change. But given @testing-library/user-event's focus on recreating actual user interactions, I'd expect that to happen automatically.