Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support beforeInput event #1152

Open
zombieJ opened this issue Nov 15, 2022 · 4 comments
Open

Support beforeInput event #1152

zombieJ opened this issue Nov 15, 2022 · 4 comments

Comments

@zombieJ
Copy link

zombieJ commented Nov 15, 2022

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

@hjonasson
Copy link

@zombieJ Could you please describe beforeInput in some detail so it can be investigated further.

@eps1lon
Copy link
Member

eps1lon commented Dec 6, 2022

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

@gsuntres
Copy link

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

@MatanBobi
Copy link
Member

MatanBobi commented Nov 6, 2023

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: facebook/react#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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants