Skip to content

Commit

Permalink
Prevent default for links to avoid double click events
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Jun 25, 2021
1 parent 1f2d2ee commit 8a89495
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 8a89495

Please sign in to comment.