Skip to content

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

Open

Description

@perezpz

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>
    );
  }
}

Activity

  1. changed the title [-]the submenu cannot hidden after animation end or mouse leave[/-] [+]the submenu cannot hide after animation end or mouse leave[/+] on Jul 13, 2021
  2. changed the title [-]the submenu cannot hide after animation end or mouse leave[/-] [+]The submenu cannot hide after animation end or mouse leave[/+] on Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions