-
Notifications
You must be signed in to change notification settings - Fork 1.1k
onBlur not firing on valid input #543
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
Comments
Could you clarify why the onBlur handler should be called in the second test case when the element isn't blurred? |
Could it be related to this? #376 (comment) |
Yes @msurekci, I believe that's exactly the problem. I'm afraid there's nothing we can do here. You'll need to fire the blur event manually. |
Ah makes sense! @kentcdodds Do you think this would be a candidate to get added to the FAQ or potentially the actions documentation page? |
Yes. If you would like to make a pull request to add it I would be grateful! |
Hello! I've ran into an issue where
onBlur
handler's are not being fired properly when I try to interact with them usingfireEvent
and normal actions (like click and tab). If I usefireEvent.focus
andfireEvent.blur
it works fine, but I'd really prefer testing with the standard events.I saw what looked like a related issue in #359 but that revolved around the input not having
type="text
, which I've covered in my use case.react-testing-library
version: 9.1.4react
version: 16.9I've created a minimal reproduction case here
https://codesandbox.io/s/onblur-not-working-yv1dv
The text was updated successfully, but these errors were encountered: