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

Not being able to set a keyCode for a KeyboardEvent #1043

Closed
grassator opened this issue Sep 6, 2023 · 0 comments · Fixed by #1301
Closed

Not being able to set a keyCode for a KeyboardEvent #1043

grassator opened this issue Sep 6, 2023 · 0 comments · Fixed by #1301
Assignees
Labels
bug Something isn't working

Comments

@grassator
Copy link

Describe the bug
Right now KeyboardEvent does not allow to set a keyCode.

To Reproduce

const e = new KeyboardEvent('keydown', { keyCode: 40 });
console.log(e.keyCode); // undefined, expected 40

Expected behavior
I would expect keyCode to be propagated from the event init object to the event itself.


The change is pretty trivial and I am happy to submit a PR if required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants