Skip to content

Commit

Permalink
fix: port #2003
Browse files Browse the repository at this point in the history
  • Loading branch information
DaiQiangReal committed Jan 23, 2024
1 parent df3535f commit 1ac4d06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/semi-ui/dropdown/dropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DropdownItem extends BaseComponent<DropdownItemProps> {
forwardRef: PropTypes.func,
type: PropTypes.oneOf(strings.ITEM_TYPE),
active: PropTypes.bool,
icon: PropTypes.node
icon: PropTypes.node,
};

static contextType = DropdownContext;
Expand Down Expand Up @@ -93,7 +93,8 @@ class DropdownItem extends BaseComponent<DropdownItemProps> {
const events = {};
if (!disabled) {
['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
if (eventName === "onClick") {
const isInAnotherDropdown = this.context.level!==1;
if (isInAnotherDropdown && eventName==="onClick") {
events["onMouseDown"] = (e: React.MouseEvent<HTMLLIElement, MouseEvent>)=>{
if (e.button===0) {
this.props[eventName]?.(e);
Expand Down

0 comments on commit 1ac4d06

Please sign in to comment.