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

Feature: Switch from deprecated keyCode to key in internal onKeyDown handler #6051

Closed
noahnu opened this issue May 7, 2024 · 0 comments
Closed
Assignees
Labels
enhancement Improvement over existing feature soon-will-cause-trouble These issues will soon turn into bugs if not addresses in a timely manner.

Comments

@noahnu
Copy link

noahnu commented May 7, 2024

keyCode is deprecated (see https://w3c.github.io/uievents/#legacy-KeyboardEvent). As "keyCode" is officially deprecated, lexical should be updated to replace all references to keyCode with either KeyboardEvent.code or KeyboardEvent.key where applicable.

One of the functions using the deprecated keyCode:

function onKeyDown(event: KeyboardEvent, editor: LexicalEditor): void {

What's the impact? The popular @testing-library/user-event package no longer sets "keyCode" on their synthetic keyboard events.

@noahnu noahnu added the enhancement Improvement over existing feature label May 7, 2024
@StyleT StyleT added the soon-will-cause-trouble These issues will soon turn into bugs if not addresses in a timely manner. label May 7, 2024
@Sahejkm Sahejkm self-assigned this May 8, 2024
@Sahejkm Sahejkm closed this as completed in 6a33ccf May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement over existing feature soon-will-cause-trouble These issues will soon turn into bugs if not addresses in a timely manner.
Projects
None yet
Development

No branches or pull requests

3 participants