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

Keycodes: Do not test for keyCode in isKeyboardEvent #45777

Open
swissspidy opened this issue Nov 15, 2022 · 1 comment
Open

Keycodes: Do not test for keyCode in isKeyboardEvent #45777

swissspidy opened this issue Nov 15, 2022 · 1 comment
Labels
[Package] Keycodes /packages/keycodes [Type] Enhancement A suggestion for improvement.

Comments

@swissspidy
Copy link
Member

What problem does this address?

#43147 had an issue testing keyboard shortcuts because @testing-library/user-event removed support for keyCode in version 14, but isKeyboardEvent still tests for it.

What is your proposed solution?

If that util can be adjusted to test for key instead of keyCode, then workarounds like fireEvent.keyDown() are no longer needed.

@ciampo
Copy link
Contributor

ciampo commented Nov 16, 2022

We could also rewrite the source components being tested to use code or key instead, since keyCode is effectively deprecated.

We'd just need to be careful with IME composition (see #45605)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Keycodes /packages/keycodes [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants