mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
fix(Menu): remove unexpected re-render, which causes flash and shake when collapsed
This commit is contained in:
parent
3dc031625f
commit
ad54d23a44
@ -188,6 +188,7 @@ class Menu extends React.Component<MenuProps, MenuState> {
|
||||
onClick(e);
|
||||
}
|
||||
};
|
||||
|
||||
handleOpenChange = (openKeys: string[]) => {
|
||||
this.setOpenKeys(openKeys);
|
||||
|
||||
@ -217,6 +218,9 @@ class Menu extends React.Component<MenuProps, MenuState> {
|
||||
if (this.context.siderCollapsed !== undefined) {
|
||||
return this.context.siderCollapsed;
|
||||
}
|
||||
if (this.contextSiderCollapsed) {
|
||||
return false;
|
||||
}
|
||||
return inlineCollapsed;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user