Support `beforeInput` event
Describe the feature you'd like:
fireEvent support beforeInput event
Suggested implementation:
N/A
Describe alternatives you've considered:
N/A
Teachability, Documentation, Adoption, Migration Strategy:
N/A
@zombieJ Could you please describe beforeInput in some detail so it can be investigated further.
It doesn't look like this bug report has enough info for one of us to reproduce it.
Please provide a CodeSandbox (https://react.new), or a link to a repository on GitHub.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
I've stumbled over this issue too.
Using jest, jest-environment-jsdom and @testing-library/react to test an input element that is hooked to onBeforeInput and changes the target's value.
A minimal live example https://codesandbox.io/s/dank-snowflake-ott8rx
And a repo with the problematic test https://github.com/gsuntres/testing-library-bug
Keep in mind that React aren't actually using the beforeinput event, so even if we add support for that, it won't work in RTL: https://github.com/facebook/react/issues/11211.
I'll look up what needs to be added to support that specific event in DTL (but again, it won't solve the issue for React Testing Library).