-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Adding code
property to SyntheticKeyboardEvent
with test
#11325
Adding code
property to SyntheticKeyboardEvent
with test
#11325
Conversation
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.
It looks like code
is not yet standardized and doesn't have good browser support. If we can't polyfill this for all of the other browsers React supports we might want to just wait until the DOM Level 3 Events specification moves from a working draft to a recommendation.
// as closely as possible to what would happen with a physical keyboard, to maximize | ||
// compatibility between physical and virtual input devices. | ||
if (event.type === 'keydown' || event.type === 'keyup') { | ||
return event.code; |
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.
According to MDN, code
isn't widely supported. Is there a way to cheaply polyfill this for those browsers?
This is one polyfill I could find. Alas, nothing much else. |
I'm assuming it would be a good idea to polyfill the ones we can universally detect as well, like we do for |
Closing as stale. |
This is about feature request #11306