-
Notifications
You must be signed in to change notification settings - Fork 47k
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
ReactTestUtils.Simulate no longer works as expected in v15.4.0 #8305
Comments
cc @spicyj |
This is here for 5 months. Is there any reason why firing simulate() on a disabled input/button actually fires the event? Came here from enzyme repo issue (enzymejs/enzyme#386) and it turns out our shallow() rendered components still call onClick even if disabled attribute is there. |
There are many issues that are “here for 5 months”. It’s a popular repository, and the team is very small. This is a low priority issue because it’s not actively breaking apps. If you have specific suggestions about how to fix this, please propose them! Read the past discussions, research the motivation behind previous changes, and present a proposal of how we should handle this instead. Maybe even send a PR 😉 . You are in the best position to do this because you are actively invested in solving this, and you actually have the context to know how it affects apps. |
What I more had in mind, is to just have a clarification whether the problem is actually a bug or is it intended (I can imagine scenarios when you want to have mouse event firing on a disabled input element) - I did not expect the fix to be released immediately. In short - I wanted an answer, not immediate fix because it's "here for 5 months". |
Let’s ask @nhunzaker for context on this. |
For reference, there were additional changes made to that code path in #8387 |
Sorry for the delay... This was intentional, we did it when we moved the disabled click event behavior from an, at the time, wrapper around Buttons to the SimpleEventPlugin: The trade-off was that it would allow |
Firstly, congrats on the release :)
With the v15.4.0 update, a couple of our projects tests are failing given the changes to
ReactTestUtils.Simulate
as discussed here:#7642 (comment)
The work-around was to use
ReactTestUtils.SimulateNative
- however it's still not entirely clear what the difference betweenSimulate
andSimulateNative
are? When and why should one be used over the other?It feels like these docs should be updated to reflect this change:
https://facebook.github.io/react/docs/test-utils.html#simulate
Finally, is there a reason that
SimulateNative
does not appear in the docs? I'm concerned that others are going to be caught out by this change also.The text was updated successfully, but these errors were encountered: