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

Keyboard interactions are based on keyCode which is deprecated #14

Open
gavmck opened this issue Feb 12, 2025 · 0 comments
Open

Keyboard interactions are based on keyCode which is deprecated #14

gavmck opened this issue Feb 12, 2025 · 0 comments

Comments

@gavmck
Copy link

gavmck commented Feb 12, 2025

It looks like they keyboard interaction handlers in utils are based on the keyCode property, which is deprecated.

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

These should be updated to use the code or key property instead.

You should avoid using this if possible; it's been deprecated for some time. Instead, you should use KeyboardEvent.code (for the physical key pressed) or KeyboardEvent.key (for the character the key maps to). Check compatibility for either property if you target very old browsers.

This is causing problems using testing library to test the interactions in this components because they no longer support keyCode in keyboard events.

testing-library/user-event#842 (comment)

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

No branches or pull requests

1 participant