[react-events] Rely on 'buttons' rather than 'button'#16479
Merged
necolas merged 1 commit intofacebook:masterfrom Aug 21, 2019
Merged
[react-events] Rely on 'buttons' rather than 'button'#16479necolas merged 1 commit intofacebook:masterfrom
necolas merged 1 commit intofacebook:masterfrom
Conversation
|
No significant bundle size changes to report. Generated by 🚫 dangerJS |
necolas
commented
Aug 19, 2019
trueadm
reviewed
Aug 19, 2019
trueadm
reviewed
Aug 19, 2019
Contributor
There was a problem hiding this comment.
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).
trueadm
approved these changes
Aug 19, 2019
necolas
commented
Aug 20, 2019
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
Contributor
|
Seems like there's maybe a case we haven't handled here. Middle mouse buttons are reported with |
Contributor
Author
|
Reported as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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