🐛 Fix Menu lost state when collapsed to 0px

close #18825
This commit is contained in:
afc163 2019-09-19 21:50:00 +08:00 committed by 偏右
parent ca6e2f36c8
commit 54ffa2cea6

View File

@ -297,11 +297,11 @@ class InternalMenu extends React.Component<InternalMenuProps, MenuState> {
}
// https://github.com/ant-design/ant-design/issues/8587
if (
const hideMenu =
this.getInlineCollapsed() &&
(collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px')
) {
return null;
(collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px');
if (hideMenu) {
menuProps.openKeys = [];
}
return (