-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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] Rely on 'buttons' rather than 'button' #16479
[react-events] Rely on 'buttons' rather than 'button' #16479
Conversation
No significant bundle size changes to report. Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused as to why this is buttons = 1 | 4
rather than 1 | 2 | 4
?
0 MUST indicate no button is currently active.
1 MUST indicate the primary button of the device (in general, the left button or the only button on single-button devices, used to activate a user interface control or select text).
2 MUST indicate the secondary button (in general, the right button, often used to display a context menu), if present.
4 MUST indicate the auxiliary button (in general, the middle button, often combined with a mouse wheel).
packages/react-events/src/dom/testing-library/domEventSequences.js
Outdated
Show resolved
Hide resolved
The semantics of 'button' on events differs between PointerEvent and MouseEvent, whereas they are the same for 'buttons'. Furthermore, 'buttons' allows developers to determine when multiple buttons are pressed as the same time. https://w3c.github.io/pointerevents/#the-button-property
006137a
to
25eb83f
Compare
Seems like there's maybe a case we haven't handled here. Middle mouse buttons are reported with |
Reported as |
The semantics of 'button' on events differs between PointerEvent and
MouseEvent, whereas they are the same for 'buttons'. Furthermore, 'buttons'
allows developers to determine when multiple buttons are pressed as the same
time.
https://w3c.github.io/pointerevents/#the-button-property