[3.0] SubMenu collapses while hovering
See original GitHub issueI can’t select 3.0 in the issue app so I’ll just try it like this anyway.
Using 3.0.0-beta.5 on Chrome. When I hover over the submenu, it opens but collapses when I try to select an item. The only way to keep it open is to hover over the first item link exactly.
Here is a screen recording:
https://www.dropbox.com/s/jdxakivocf5atgs/antd-submenu-bug.mov?dl=0
import React from 'react';
import { Link } from 'react-router-dom';
import { Menu, Avatar } from 'antd';
const { SubMenu, Item, Divider } = Menu;
import styled from 'styled-components';
const Box = styled.span`
position: relative;
display: flex;
align-items: center;
height: 64px;
`;
interface INavigationProps {
onLogout: () => any;
isAuthed: boolean;
avatar?: string;
}
export const Navigation: React.SFC<INavigationProps> = ({
isAuthed,
onLogout,
avatar,
}) =>
isAuthed && (
<Menu mode="horizontal" style={{ lineHeight: '64px' }}>
<Item key="admin">
<Link to="/admin">admin</Link>
</Item>
<SubMenu
key="user"
mode="inline"
title={
<Box>
<Avatar src={avatar} icon="user" />
</Box>
}
>
<Item key="user.profile">
<Link to="/profile">profile</Link>
</Item>
<Divider />
<Item key="user.logout">
<Link to="/" onClick={onLogout}>
logout
</Link>
</Item>
</SubMenu>
</Menu>
);
export default Navigation;
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
My navbar collapse is collapsing but when im not hovering on it
The key is to set the dropdown to visility:hidden; in the start and visility:visible; in :hover state. .fixed-top { position: fixed; ...
Read more >Symptom: Submenus (dropdowns) not displaying - SevenSpark
Symptom Details. The submenu opens when hovering over a top level menu item, but the animations do not occur. Menu items completely unstyled....
Read more >Bootstrap Dropdown Hover
Bootstrap based responsive mulltilevel dropdown navigation menu with fascinating animations.
Read more >JavaScript · Bootstrap
collapsing is applied during transitions .collapse.in shows content. You can use a link with the href attribute, or a button with the data ......
Read more >Should an opened sub-menu collapse when the user opens ...
And as far as user's expectations are concerned, as most of the Submenus at present collapse automatically as soon as one clicks the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can fork this one https://codepen.io/yesmeck/pen/VrmpEj?editors=0010
The problem seems to have disappeared after upgrading to beta 6