Skip to content

Commit

Permalink
Fix menu submenu animation, close #12864
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Oct 30, 2018
1 parent 72a6feb commit f7fa8e0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions components/menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import { findDOMNode } from 'react-dom';
import RcMenu, { Divider, ItemGroup } from 'rc-menu';
import * as PropTypes from 'prop-types';
import classNames from 'classnames';
Expand Down Expand Up @@ -79,7 +78,6 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
collapsedWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
};
switchModeFromInline: boolean;
leaveAnimationExecutedWhenInlineCollapsed: boolean;
inlineOpenKeys: string[] = [];
constructor(props: MenuProps) {
super(props);
Expand Down Expand Up @@ -113,7 +111,6 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
};
}
componentWillReceiveProps(nextProps: MenuProps, nextContext: SiderContext) {
const { prefixCls } = this.props;
if (this.props.mode === 'inline' &&
nextProps.mode !== 'inline') {
this.switchModeFromInline = true;
Expand All @@ -124,9 +121,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
}
if ((nextProps.inlineCollapsed && !this.props.inlineCollapsed) ||
(nextContext.siderCollapsed && !this.context.siderCollapsed)) {
const menuNode = findDOMNode(this) as Element;
this.switchModeFromInline =
!!this.state.openKeys.length && !!menuNode.querySelectorAll(`.${prefixCls}-submenu-open`).length;
this.switchModeFromInline = true;
this.inlineOpenKeys = this.state.openKeys;
this.setState({ openKeys: [] });
}
Expand Down

1 comment on commit f7fa8e0

@afc163
Copy link
Member Author

@afc163 afc163 commented on f7fa8e0 Oct 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted for breaking ci

Please sign in to comment.