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.

Add data-bs-dismiss="dropdown" to close dropdown on button click

See original GitHub issue

We have similar options for modal, offcanvas and alert, where components can be dismissed on button click. But there’s no way to close dropdown menu with data-bs-auto-close="inside" from the dropdown itself. A simple example would be individual action button like Apply or Close/Cancel in dropdown with a form - user can fill out the form and click Apply to submit the form and close the menu. In that scenario, having an option to dismiss the menu by clicking the button that has data-bs-dismiss="dropdown" would be super handy.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
Kopyovcommented, Sep 18, 2021

Well, closing modals and alerts can be also achieved via a small script, but we have data-dismiss thing for some reason. Why don’t we have it also for dropdowns? 😁

0reactions
mdocommented, Apr 12, 2022

Closing as a won’t fix. If folks have suggestions for demos and snippets to add to the docs to show this though, we’d be happy to review and merge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Close Bootstrap Dropdown after link click - Stack Overflow
the best answer will be is to perform click so it will act the same as the user click the mouse to hide...
Read more >
Dropdowns - Bootstrap
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown ...
Read more >
Bootstrap JS Dropdown Reference - W3Schools
Add data -toggle="dropdown" to a link or a button to toggle a dropdown menu. ... hide.bs.dropdown, Occurs when the dropdown is about to...
Read more >
How to avoid dropdown menu to close menu items on clicking ...
The default behavior of a dropdown menu is to close the menu list items when clicked inside. In this article, We will use...
Read more >
Hide Dropdown via js - Material Design for Bootstrap
$(function () { $(".dropdown-menu > li a").click(function () { console.log("clicked"); return false; }); });
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