Skip to content
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

Conversation

flaviolivolsi
Copy link

This is about feature request #11306

Copy link
Contributor

@aweary aweary left a 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;
Copy link
Contributor

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?

@flaviolivolsi
Copy link
Author

This is one polyfill I could find. Alas, nothing much else.

@syranide
Copy link
Contributor

I'm assuming it would be a good idea to polyfill the ones we can universally detect as well, like we do for key. The list of possible keys should probably be more or less the same too.

@gaearon
Copy link
Collaborator

gaearon commented Jan 5, 2018

Closing as stale.

@gaearon gaearon closed this Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants