Skip to content

Use keyCode instead of key #211

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

Merged
merged 1 commit into from
Oct 6, 2017
Merged

Use keyCode instead of key #211

merged 1 commit into from
Oct 6, 2017

Conversation

taion
Copy link
Member

@taion taion commented Oct 6, 2017

Fixes #210

Sorry @jeffredodd!

@jquense
Copy link
Member

jquense commented Oct 6, 2017

I don't think this fixes it...React normalizes "Esc" -> "Escape" https://github.com/facebook/react/blob/master/src/renderers/dom/shared/utils/getEventKey.js

@taion
Copy link
Member Author

taion commented Oct 6, 2017

It does, but this is the document keydown event, so it's not going through React.

@jquense
Copy link
Member

jquense commented Oct 6, 2017

ooo

@taion taion merged commit 11276b9 into master Oct 6, 2017
@taion taion deleted the keyCode branch October 6, 2017 16:12
taion added a commit that referenced this pull request Oct 6, 2017
@jeffredodd
Copy link
Contributor

Haha @taion I knew something was weird about using key! Now we all know! 😄

@taion
Copy link
Member Author

taion commented Oct 6, 2017

It would be the correct thing if it were a React event, I think, since React normalizes key, plus keyCode is deprecated, but I think this is the best option for handler a browser event for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants