Skip to content

Commit

Permalink
fix(Menu): emit click event on Item with Enter or Space
Browse files Browse the repository at this point in the history
  • Loading branch information
LexSwed committed Oct 3, 2020
1 parent db7b2f3 commit bf3ae97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/Menu/MenuList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function useMenuProps({ placement = 'bottom-start', offset = 8, ...props }: Prop
if (!onAction) return;
console.log(stateRef.current.items.get(li));
const action = stateRef.current.items.get(li)?.action;
action && onAction(action);
if (action) {
onAction(action);
} else {
li.click();
}
},
[onAction, stateRef]
);
Expand Down

0 comments on commit bf3ae97

Please sign in to comment.