question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[3.0] SubMenu collapses while hovering

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
yesmeckcommented, Nov 8, 2017
0reactions
0x80commented, Nov 13, 2017

The problem seems to have disappeared after upgrading to beta 6

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found