-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
[react-events] Add ContextMenu responder #16296
Conversation
Details of bundled changes.Comparing: 6b565ce...8077f45 react-events
Generated by 🚫 dangerJS |
e8c8aaf
to
aa3ed37
Compare
Note: this responder uses a different approach to defining the native events it listens to, and surfaces an issue our existing responders. The In contrast, the existing responders listen to pointer events by default, and if those aren't supported they add fallback events. In the unit test environment, pointer events aren't supported so the responder always adds the fallback events! However, in the unit tests we still dispatch native pointer events in almost all the scenarios. This creates an unrealistic environment, where a browser is dispatching pointer events but React is also listening to the fallback events! As such, the existing unit tests are both imposing greater complexity on the PointerEvents implementation that would occur in reality (i.e., listening to fallback events and having to deal with them) and potentially covering up bugs if the PointerEvents path accidentally ends up depending on state changes caused by the fallback events (because those events won't be listened to outside of the unit test env). |
A module for responding to contextmenu events. This functionality will be removed from the Press responder in the future.
aa3ed37
to
8077f45
Compare
Hi @necolas is there any way I can test this experimental module in a react app? Thanks. |
A module for responding to contextmenu events. This functionality will be
removed from the Press responder in the future.