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

Add code property to SyntheticKeyboardEvent #11306

Closed
jacobcarpenter opened this issue Oct 20, 2017 · 6 comments
Closed

Add code property to SyntheticKeyboardEvent #11306

jacobcarpenter opened this issue Oct 20, 2017 · 6 comments
Labels

Comments

@jacobcarpenter
Copy link

Do you want to request a feature or report a bug?

Improvement

What is the current behavior?

SyntheticKeyboardEvent does not currently support the code property.

code (MDN) is nice to have when you want to write key-specific handling—rather than input-specific (dependent on layout and modifier keys) handling.

What is the expected behavior?

SyntheticKeyboardEvent already exposes a keyCode property. It should have a code property as well.

Currently, if you want to use the keyboardEvent's code, you must access it through SyntheticKeyboardEvent's nativeEvent.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Affects React 16 and earlier (I assume).

@flaviolivolsi
Copy link

I created the PR #11325 for this.

@thisizkp
Copy link

the above PR #11325 is stale and closed; should I pick this up? planning to replicate the same and follow the PR suggestions; any tips or idea?

@gaearon
Copy link
Collaborator

gaearon commented Aug 15, 2018

Can you give me an idea of how widely supported it is?

@lukaszgolder
Copy link

lukaszgolder commented Aug 16, 2018

@gaearon According to https://caniuse.com/#feat=keyboardevent-code it is supported in all major desktop browsers. Are there any plans to implement this? I am not sure whether I should mark it with $FlowFixMe until this issue is resolved or don't use it at all.

@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@stale
Copy link

stale bot commented Jan 19, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants