|
@@ -47,7 +47,7 @@ class DropdownItem extends BaseComponent<DropdownItemProps> {
|
|
forwardRef: PropTypes.func,
|
|
forwardRef: PropTypes.func,
|
|
type: PropTypes.oneOf(strings.ITEM_TYPE),
|
|
type: PropTypes.oneOf(strings.ITEM_TYPE),
|
|
active: PropTypes.bool,
|
|
active: PropTypes.bool,
|
|
- icon: PropTypes.node
|
|
|
|
|
|
+ icon: PropTypes.node,
|
|
};
|
|
};
|
|
|
|
|
|
static contextType = DropdownContext;
|
|
static contextType = DropdownContext;
|
|
@@ -93,7 +93,8 @@ class DropdownItem extends BaseComponent<DropdownItemProps> {
|
|
const events = {};
|
|
const events = {};
|
|
if (!disabled) {
|
|
if (!disabled) {
|
|
['onClick', 'onMouseEnter', 'onMouseLeave', 'onContextMenu'].forEach(eventName => {
|
|
['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>)=>{
|
|
events["onMouseDown"] = (e: React.MouseEvent<HTMLLIElement, MouseEvent>)=>{
|
|
if (e.button===0) {
|
|
if (e.button===0) {
|
|
this.props[eventName]?.(e);
|
|
this.props[eventName]?.(e);
|