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.

[Dropdown] Trigger dropdown menu on click on deeper levels of dropdown menus (instead of hover)

See original GitHub issue

On multi level dropdown lists, the deeper-level dropdown menus are triggered on hover, not on click, even when in the JS initialization, it’s specified the triggering event would be click. Here’s a link to the JS fiddle. How do I trigger those deeper-level dropdown menus on click instead?

<div class="ui dropdown button">
  <span class="text">Choose Category</span>
  <i class="dropdown icon"></i>
  <div class="menu">
    <div class="item">
      <span class="text">Category 1</span>
    </div>
    <div class="item">
      <i class="dropdown icon"></i>
      <span class="text">Category 2</span>
      <div class="menu">
        <div class="item">Item 2A</div>
        <div class="item">Item 2B</div>
      </div>
    </div>
  </div>
</div>

Here’s the JS initialization:

$('.ui.dropdown').dropdown({
    on: 'click',
    action: 'nothing'
});

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
awgvcommented, Jul 25, 2017

@quantran13 Sorry for the delay, that’s because .ui.dropdown is unnecessary for child dropdowns. So, instead of doing <div class="ui dropdown link item"> you should be doing <div class="link item">.

0reactions
stale[bot]commented, Feb 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dropdown Menus with More Forgiving Mouse Movement Paths
Dropdown menus are typically designed such that a submenu is revealed through CSS on a :hover of a parent element.
Read more >
Frustrating Design Patterns: Mega-Dropdown Hover Menus
Designing A Better Mega-Dropdown: Tap/Click Menu #. One of the common reasons why mega-dropdowns often open on hover because many large ...
Read more >
How to create a multilevel dropdown menu in React
Multilevel menus are designed to reveal the deeply nested navigations when we click or hover over the submenu items, as shown in the...
Read more >
what's the best approach? Dropdown, hovers, clicks or ...
I agree with this post from Mark Root-Wiley which argues that dropdown navigation menus are best activiated when a user clicks the link...
Read more >
Should my menus drop down on hover + on click or just on ...
Seems to me you need dropdowns like those below that open up on click not hover - with the down arrow acting as...
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