Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The submenu cannot hide after animation end or mouse leave #417

Open
perezpz opened this issue Jul 13, 2021 · 0 comments
Open

The submenu cannot hide after animation end or mouse leave #417

perezpz opened this issue Jul 13, 2021 · 0 comments

Comments

@perezpz
Copy link

perezpz commented Jul 13, 2021

source code:

import * as React from 'react';
import Menu, { SubMenu, MenuItem } from 'rc-menu';
import classNames from 'classnames';
import 'rc-menu/assets/index.css';

const horizontalMotion = {
  motionName: 'rc-menu-open-slide-up',
  motionAppear: true,
  motionEnter: true,
  motionLeave: true
};

const children = [
  <MenuItem key="1">认识小新</MenuItem>,
  <SubMenu key="2" title="到店体验">
    <MenuItem key="2-1">2-1</MenuItem>
  </SubMenu>,
  <SubMenu key="3" className="submenu" title="关于我们">
    <MenuItem key="3-1">企业介绍</MenuItem>
    <MenuItem key="3-2">媒体中心</MenuItem>
    <MenuItem key="3-3">加入我们</MenuItem>
  </SubMenu>,
  <SubMenu key="4" title="探索更多">
    <MenuItem key="4-1">4-1</MenuItem>
  </SubMenu>
];

export default class CustomMenu extends React.PureComponent {
  render() {
    this.config = {
      triggerSubMenuAction: 'hover',
      mode: 'horizontal',
      defaultMotions: { horizontal: horizontalMotion }
    };
    return (
      <Menu defaultActiveFirst {...this.config}>
        {children}
      </Menu>
    );
  }
}
@perezpz perezpz changed the title the submenu cannot hidden after animation end or mouse leave the submenu cannot hide after animation end or mouse leave Jul 13, 2021
@perezpz perezpz changed the title the submenu cannot hide after animation end or mouse leave The submenu cannot hide after animation end or mouse leave Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant