This commit is contained in:
ztplz 2019-03-12 19:52:43 +08:00 committed by zombieJ
parent f65853b2b1
commit 97880a9b47
2 changed files with 5 additions and 0 deletions

View File

@ -31,9 +31,11 @@ class SubMenu extends React.Component<SubMenuProps, any> {
onKeyDown = (e: React.MouseEvent<HTMLElement>) => {
this.subMenu.onKeyDown(e);
};
saveSubMenu = (subMenu: any) => {
this.subMenu = subMenu;
};
render() {
const { rootPrefixCls, className } = this.props;
const theme = this.context.antdMenuTheme;

View File

@ -157,6 +157,7 @@ class Menu extends React.Component<MenuProps, MenuState> {
onMouseEnter(e);
}
};
handleTransitionEnd = (e: TransitionEvent) => {
// when inlineCollapsed menu width animation finished
// https://github.com/ant-design/ant-design/issues/12864
@ -169,6 +170,7 @@ class Menu extends React.Component<MenuProps, MenuState> {
this.restoreModeVerticalFromInline();
}
};
handleClick = (e: ClickParam) => {
this.handleOpenChange([]);
@ -185,6 +187,7 @@ class Menu extends React.Component<MenuProps, MenuState> {
onOpenChange(openKeys);
}
};
setOpenKeys(openKeys: string[]) {
if (!('openKeys' in this.props)) {
this.setState({ openKeys });