-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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] Keyboard calls preventDefault on 'click' events #16779
[react-events] Keyboard calls preventDefault on 'click' events #16779
Conversation
Details of bundled changes.Comparing: 137ea78...2353c0b react-events
|
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.
Some of the tests are failing but overall it looks okay.
@@ -150,6 +156,7 @@ function createKeyboardEvent( | |||
isComposing, | |||
key: getEventKey(nativeEvent), | |||
metaKey, | |||
pointerType: 'keyboard', |
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.
Do we really need a pointerType for keyboard responder?
@@ -16,26 +16,32 @@ import React from 'react'; | |||
import {DiscreteEvent} from 'shared/ReactTypes'; | |||
import type {ReactEventResponderListener} from 'shared/ReactTypes'; | |||
|
|||
type KeyboardEventType = 'keydown' | 'keyup'; | |||
type KeyboardEventType = 'keyboard:keydown' | 'keyboard:keyup'; |
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 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?
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 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'
a3214b0
to
2353c0b
Compare
Make sure to call preventDefault for any 'click' events that follow a 'keydown'
event that matches 'preventKeys'.