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

fix(MenuItem,MenuItem2): Enter keypress should trigger onClick #6044

Merged

Conversation

bvandercar-vt
Copy link
Contributor

@bvandercar-vt bvandercar-vt commented Mar 28, 2023

Fixes #6056

Checklist

  • Includes tests
  • [N/A] Update documentation

Changes proposed in this pull request:

Enable pressing enter on menuitem components. React does not apply onClick when enter is pressed on a role="menuitem" component like it does for a button, apply fix for this.

@adidahiya
Copy link
Contributor

I can confirm this works in the docs preview build (this behavior was not possible before):

2023-04-18 12 42 06

Not sure how useful the spacebar triggering will be, as that often causes the page to scroll, but it seems reasonable to leave in for now.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

thanks for adding unit tests 👍

@adidahiya adidahiya merged commit 486fbe2 into palantir:develop Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MenuItem / MenuItem2 enter button doesn't have same effect as click
2 participants