-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Menu: Support number pad keyboard input #1732
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
Conversation
@fnagel, thanks for your PR! By analyzing the annotation information on this pull request, we identified @jzaefferer, @apsdehal and @scottgonzalez to be potential reviewers |
@arschmitz FYI |
skip = false; | ||
|
||
// Support number pad values | ||
character = event.keyCode >= 96 && event.keyCode <= 105 ? | ||
event.keyCode - 96 : String.fromCharCode( event.keyCode ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this really matters in this case but when event.keyCode >= 96 && event.keyCode <= 105
we get a number
here and when it's less we get a string
. Do we want to force character to always be a string for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was my thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So adding something like ( event.keyCode - 9 ).toString();
would be suitable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that'd be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
04a168f
to
70617f1
Compare
Fixes #15031
70617f1
to
1edd9a1
Compare
Looks good. |
Fixes #15031