mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
parent
1856fbe0df
commit
5da1403bc0
@ -102,11 +102,11 @@ export default class Menu extends React.Component<MenuProps, any> {
|
||||
(nextContext.siderCollapsed && !this.context.siderCollapsed)) {
|
||||
this.switchModeFromInline = !!this.state.openKeys.length;
|
||||
this.inlineOpenKeys = this.state.openKeys;
|
||||
this.setOpenKeys([]);
|
||||
this.handleOpenChange([]);
|
||||
}
|
||||
if ((!nextProps.inlineCollapsed && this.props.inlineCollapsed) ||
|
||||
(!nextContext.siderCollapsed && this.context.siderCollapsed)) {
|
||||
this.setOpenKeys(this.inlineOpenKeys);
|
||||
this.handleOpenChange(this.inlineOpenKeys);
|
||||
this.inlineOpenKeys = [];
|
||||
}
|
||||
if ('openKeys' in nextProps) {
|
||||
@ -114,7 +114,7 @@ export default class Menu extends React.Component<MenuProps, any> {
|
||||
}
|
||||
}
|
||||
handleClick = (e) => {
|
||||
this.setOpenKeys([]);
|
||||
this.handleOpenChange([]);
|
||||
|
||||
const { onClick } = this.props;
|
||||
if (onClick) {
|
||||
@ -136,7 +136,7 @@ export default class Menu extends React.Component<MenuProps, any> {
|
||||
}
|
||||
getRealMenuMode() {
|
||||
const inlineCollapsed = this.getInlineCollapsed();
|
||||
if (this.switchModeFromInline && inlineCollapsed) {
|
||||
if (this.switchModeFromInline && inlineCollapsed && !('openKeys' in this.props)) {
|
||||
return 'inline';
|
||||
}
|
||||
const { mode } = this.props;
|
||||
|
Loading…
Reference in New Issue
Block a user