feat: menu support forceSubMenuRender
parent
17c7cb30a3
commit
c07d1eab41
|
@ -116,6 +116,7 @@ const SubPopupMenu = {
|
||||||
expandIcon: PropTypes.any,
|
expandIcon: PropTypes.any,
|
||||||
overflowedIndicator: PropTypes.any,
|
overflowedIndicator: PropTypes.any,
|
||||||
children: PropTypes.any.def([]),
|
children: PropTypes.any.def([]),
|
||||||
|
forceSubMenuRender: PropTypes.looseBool,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prefixCls: 'rc-menu',
|
prefixCls: 'rc-menu',
|
||||||
|
@ -303,7 +304,6 @@ const SubPopupMenu = {
|
||||||
openAnimation: props.openAnimation,
|
openAnimation: props.openAnimation,
|
||||||
subMenuOpenDelay: props.subMenuOpenDelay,
|
subMenuOpenDelay: props.subMenuOpenDelay,
|
||||||
subMenuCloseDelay: props.subMenuCloseDelay,
|
subMenuCloseDelay: props.subMenuCloseDelay,
|
||||||
forceSubMenuRender: props.forceSubMenuRender,
|
|
||||||
builtinPlacements: props.builtinPlacements,
|
builtinPlacements: props.builtinPlacements,
|
||||||
itemIcon: this.getIcon(child, 'itemIcon') || this.getIcon(this, 'itemIcon'),
|
itemIcon: this.getIcon(child, 'itemIcon') || this.getIcon(this, 'itemIcon'),
|
||||||
expandIcon: this.getIcon(child, 'expandIcon') || this.getIcon(this, 'expandIcon'),
|
expandIcon: this.getIcon(child, 'expandIcon') || this.getIcon(this, 'expandIcon'),
|
||||||
|
@ -318,6 +318,9 @@ const SubPopupMenu = {
|
||||||
// destroy: this.onDestroy,
|
// destroy: this.onDestroy,
|
||||||
onSelect: this.onSelect,
|
onSelect: this.onSelect,
|
||||||
};
|
};
|
||||||
|
if (props.forceSubMenuRender !== undefined) {
|
||||||
|
newChildProps.forceSubMenuRender = props.forceSubMenuRender;
|
||||||
|
}
|
||||||
// ref: https://github.com/ant-design/ant-design/issues/13943
|
// ref: https://github.com/ant-design/ant-design/issues/13943
|
||||||
if (props.mode === 'inline' || isMobileDevice()) {
|
if (props.mode === 'inline' || isMobileDevice()) {
|
||||||
newChildProps.triggerSubMenuAction = 'click';
|
newChildProps.triggerSubMenuAction = 'click';
|
||||||
|
|
Loading…
Reference in New Issue