[react-events] Keyboard calls preventDefault on 'click' events#16779
Merged
necolas merged 1 commit intoSep 13, 2019
Merged
Conversation
Details of bundled changes.Comparing: 137ea78...2353c0b react-events
|
trueadm
approved these changes
Sep 13, 2019
trueadm
left a comment
Contributor
There was a problem hiding this comment.
Some of the tests are failing but overall it looks okay.
trueadm
reviewed
Sep 13, 2019
| isComposing, | ||
| key: getEventKey(nativeEvent), | ||
| metaKey, | ||
| pointerType: 'keyboard', |
Contributor
There was a problem hiding this comment.
Do we really need a pointerType for keyboard responder?
trueadm
reviewed
Sep 13, 2019
| import type {ReactEventResponderListener} from 'shared/ReactTypes'; | ||
|
|
||
| type KeyboardEventType = 'keydown' | 'keyup'; | ||
| type KeyboardEventType = 'keyboard:keydown' | 'keyboard:keyup'; |
Contributor
There was a problem hiding this comment.
I guess the keyboard prefix is because we're also adding the keyboard pointer type. What do you expect this to expand to in the future?
Contributor
Author
There was a problem hiding this comment.
I think we should scope event names to their responder, especially given that keydown and keyup are also the names of native events
Make sure to call preventDefault for any 'click' events that follow a 'keydown' event that matches 'preventKeys'
necolas
force-pushed
the
react-events/use-keyboard-prevents-click
branch
from
September 13, 2019 19:56
a3214b0 to
2353c0b
Compare
mrizwanashiq
pushed a commit
to mrizwanashiq/react
that referenced
this pull request
Jun 25, 2026
…#16779) Make sure to call preventDefault for any 'click' events that follow a 'keydown' event that matches 'preventKeys'
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.
Make sure to call preventDefault for any 'click' events that follow a 'keydown'
event that matches 'preventKeys'.