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

switch keyboard shortcut handling to KeyboardEvent.code API #8979

Open
tyrasd opened this issue Feb 11, 2022 · 1 comment
Open

switch keyboard shortcut handling to KeyboardEvent.code API #8979

tyrasd opened this issue Feb 11, 2022 · 1 comment
Labels
chore Improvements to the iD development experience or codebase

Comments

@tyrasd
Copy link
Member

tyrasd commented Feb 11, 2022

KeyboardEvent.code is the modern replacement for the infamous Event.keyCode. Also, all our supported browsers do support the KeyboardEvent.key API now, which means that after upgrading a few tests, we could simplify the code around

if (event.key !== undefined) {
a bit.

See also #3572, #4618 and #8905 (comment)

@tyrasd tyrasd added the chore Improvements to the iD development experience or codebase label Feb 11, 2022
@AviralSingh-code
Copy link
Contributor

Hello @tyrasd ,
I am working on this issue but I have a question that should I replace Event.keyCode with KeyboardEvent.code at every place in the iD code or just the keybinding.js file that you have pointed out ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Improvements to the iD development experience or codebase
Projects
None yet
Development

No branches or pull requests

2 participants