-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix for onMenuClick firing on every keyDown #4557
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
Fix for onMenuClick firing on every keyDown #4557
Conversation
| } | ||
|
|
||
| if (!ev.defaultPrevented && | ||
| this.props.menuTriggerKeyCode !== null && |
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.
this.props.menuTriggerKeyCode !== null [](start = 6, length = 38)
The "!== null" part is not required
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.
Can remove it :)
manishgarg1
left a comment
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.
![]()
|
@manishgarg1 Lets hold off merging this one until Bryan confirms this is what fixes his issue? :) |
|
@Markionium, absolutely. Please feel free to assign this issue to yourself if you wish to help it to completion. |
brwatt
left a comment
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.
This does fix my problem. Thank you. I did have a minor concern about the change, but I don't think its blocking issue.
|
|
||
| if (!ev.defaultPrevented && | ||
| this.props.menuTriggerKeyCode !== null && | ||
| this.props.menuTriggerKeyCode && |
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.
It doesn't seem like you want to check this.props.menuTriggerKeyCode here? It is already being handled in this._isValidMenuOpenKey.
fd3c98e to
f9b09a9
Compare
Pull request checklist
$ npm run changeDescription of changes
Bryan pointed out to me that i introduced a bug during a previous fix. The
onMenuClickfor a button should only be fired in theonKeyDownhandler when a key that should open the menu is pressed.In the current version it's fired on each
keyPressFocus areas to test
(optional)