Skip to content

Commit

Permalink
fix(menu): The same MenuItem triggers onChange multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
leezng committed Aug 7, 2023
1 parent 3945c80 commit 9607e2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MenuItem: FC<MenuItemProps> = (props) => {
if (disabled) return;

onClick && onClick({ e });
onChange(value);
if (value !== active) onChange(value);
setState({ active: value });
};

Expand Down

0 comments on commit 9607e2b

Please sign in to comment.