Skip to content

Commit

Permalink
fix(menu): change trigger element of onClick event (#3241)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangchen1031 authored Nov 29, 2024
1 parent db1184b commit 51d7123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/menu/SubMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const SubAccordion: FC<SubMenuWithCustomizeProps> = (props) => {
// 非 popup 展开
const isExpand = expanded.includes(value) && !disabled && !isPopUp;

const handleClick = (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => {
const handleClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
e.stopPropagation();
onExpand(value, expanded);
setOpen(false);
Expand Down Expand Up @@ -96,7 +96,6 @@ const SubAccordion: FC<SubMenuWithCustomizeProps> = (props) => {
[`${classPrefix}-is-disabled`]: disabled,
[`${classPrefix}-is-opened`]: isOpen,
})}
onClick={handleClick}
style={style}
onMouseEnter={() => handleMouseEvent('enter')}
onMouseLeave={() => handleMouseEvent('leave')}
Expand All @@ -106,6 +105,7 @@ const SubAccordion: FC<SubMenuWithCustomizeProps> = (props) => {
[`${classPrefix}-is-opened`]: isOpen,
[`${classPrefix}-is-active`]: checkSubMenuChildrenActive(children, active),
})}
onClick={handleClick}
>
{icon} <span className={`${classPrefix}-menu__content`}>{title}</span>
<FakeArrow style={fakeArrowStyle} isActive={isOpen} disabled={disabled} />
Expand Down

0 comments on commit 51d7123

Please sign in to comment.