Skip to content

Commit

Permalink
fix(Dropdown.Item): trigger the click event when Dropdown. Item is cl…
Browse files Browse the repository at this point in the history
…icked close ant-design#6480
  • Loading branch information
liqiuqiui committed Dec 13, 2023
1 parent 671ea15 commit 005f3da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ const Dropdown = forwardRef<DropdownRef, PropsWithChildren<DropdownProps>>(
if (isValidElement<ComponentProps<typeof Item>>(child)) {
const childProps = {
...child.props,
onClick: () => {
onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
changeActive(child.key as string)
child.props.onClick?.(event)
},
active: child.key === value,
arrow:
Expand Down

0 comments on commit 005f3da

Please sign in to comment.