Skip to content

Commit

Permalink
Prevent default for links to avoid double click events (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS authored Jun 28, 2021
1 parent 60f2f24 commit 630f631
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/menu-button/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,10 @@ const MenuItems = React.forwardRef(function MenuItems(
// consistent behavior across menu items we'll trigger a click when
// the spacebar is pressed.
if (selected) {
event.preventDefault();
if (selected.isLink && selected.element) {
selected.element.click();
} else {
event.preventDefault();
// Focus the button first by default when an item is selected.
// We fire the onSelect callback next so the app can manage
// focus if needed.
Expand Down

0 comments on commit 630f631

Please sign in to comment.