Skip to content

Fix for onMenuClick firing on every keyDown#4557

Merged
Markionium merged 4 commits into
microsoft:masterfrom
Markionium:mapol/fix-onMenuClick-firing-on-every-key-down
Apr 16, 2018
Merged

Fix for onMenuClick firing on every keyDown#4557
Markionium merged 4 commits into
microsoft:masterfrom
Markionium:mapol/fix-onMenuClick-firing-on-every-key-down

Conversation

@Markionium

@Markionium Markionium commented Apr 14, 2018

Copy link
Copy Markdown
Member

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Bryan pointed out to me that i introduced a bug during a previous fix. The onMenuClick for a button should only be fired in the onKeyDown handler when a key that should open the menu is pressed.
In the current version it's fired on each keyPress

Focus areas to test

(optional)

}

if (!ev.defaultPrevented &&
this.props.menuTriggerKeyCode !== null &&

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove it :)

@manishgarg1 manishgarg1 self-assigned this Apr 15, 2018

@manishgarg1 manishgarg1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@Markionium

Copy link
Copy Markdown
Member Author

@manishgarg1 Lets hold off merging this one until Bryan confirms this is what fixes his issue? :)

@manishgarg1

Copy link
Copy Markdown
Collaborator

@Markionium, absolutely. Please feel free to assign this issue to yourself if you wish to help it to completion.

@brwatt brwatt left a comment

Copy link
Copy Markdown
Collaborator

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 &&

Copy link
Copy Markdown
Collaborator

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.

@Markionium
Markionium force-pushed the mapol/fix-onMenuClick-firing-on-every-key-down branch from fd3c98e to f9b09a9 Compare April 16, 2018 16:43
@Markionium
Markionium merged commit 5ab4612 into microsoft:master Apr 16, 2018
@Markionium
Markionium deleted the mapol/fix-onMenuClick-firing-on-every-key-down branch April 16, 2018 17:03
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants