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.

Menu List Item - hover active state does not work if using elements

See original GitHub issue

I have a component like this.

      <Menu
        className="share-admin-menu"
        style={{
          backgroundColor: 'white',
          padding: '20px',
          color: 'white',
          width: '200px',
        }}
      >
        <Menu.List title={username} className="share-admin-menu__title">
          <Menu.List.Item
            active={active === 'edit'}
            onClick={this.onEditClick}>
              <div className="share-admin-menu__edit-container mb-one">
                <p className="share-admin-menu__text-option">
                  Edit
                </p>
                <Icon
                  className="debut-icon debut-icon--pointer ml-one"
                  icon="IconPencil"
                  color="#518DCA"
                />
              </div>
          </Menu.List.Item>
          <Menu.List.Item
            active={active === 'delete'}
            onClick={this.onDeleteClick}>
              <div className="share-admin-menu__delete-container mb-one">
                <p className="share-admin-menu__text-option">Delete</p>
                <Icon
                  className="debut-icon debut-icon--pointer ml-one"
                  icon="IconTrash"
                  color="#EA1D64"
                />
              </div>
            </Menu.List.Item>
          <Menu.List.Item
            active={active === 'detail'}
            onClick={this.onFollowersClick}>
            <div className="share-admin-menu__go-to-container">
              <p className="share-admin-menu__text-option">Go to Share</p>
              <Icon
                className="debut-icon debut-icon--pointer ml-one"
                icon="IconGo"
                color="#3ac569"
              />
            </div>
          </Menu.List.Item>
        </Menu.List>
      </Menu>

which renders out this…

Screenshot of Opera (3-19-19, 12-10-57 PM)

Visually it looks good but i lose the ability of the hover and active state. Is there a work around for this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
kkomazcommented, Apr 5, 2019

@MrCreeper1008 In the meantime ill do that 😃 thanks!

1reaction
kennethnymcommented, Mar 27, 2019

@kkomaz the behavior you are having problems with is actully a default in bulma (You can check it out here), and this library has nothing to do with it. You must wrap an a tag around any content inside the list item. That said, it would be better if this library would do the wrapping for you. I’ll make a PR in my free time.

Edit: If the sandbox does not work for you, refresh the preview and it’ll work again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

List item `li:hover` is not working - Stack Overflow
Can anyone tell me what's wrong with my code below? I'm trying to make the menu show the list when hover over each...
Read more >
States | Webflow University
The pressed or active state is the state that shows when you click or press on an element. This state inherits styles from...
Read more >
Menu Styling | Web Accessibility Initiative (WAI) - W3C
Change hovered or focused menu items, which gives users visual guidance when navigating the menu. In this example, hover and focus states use...
Read more >
Click Instead of Hover: A CSS-only "Clicky" Menu - getButterfly
Hover is not consistent; Hover is not accessible; Hover is inefficient; Peripheral items are harder to click; Click menus considerations.
Read more >
CSS Hover Not Working: How to Resolve Hover Problems
However, the problem arises when the hover state either shows or hides another element through visibility or display properties in CSS.
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