You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default .dropdown-menu hides when you click inside it. The only exception is when you have a form - it stays open when you focus on input or click buttons. It would be good to have a dedicated class .dropdown-menu-something or data attribute data-something="something" to prevent .dropdown-menu from hiding for content other than forms.
jakubmuda
changed the title
Dropdown - create a class selector to prevent closing dropdown-menu on click
v5: Dropdown - create a class/data-attribute selector to prevent closing dropdown-menu on click
Jan 7, 2021
By default
.dropdown-menu
hides when you click inside it. The only exception is when you have a form - it stays open when you focus on input or click buttons. It would be good to have a dedicated class.dropdown-menu-something
or data attributedata-something="something"
to prevent.dropdown-menu
from hiding for content other than forms.<ul class="dropdown-menu dropdown-menu-something" aria-labelledby="dropdownMenuButton">
OR
<ul class="dropdown-menu" data-something="something" aria-labelledby="dropdownMenuButton">
It looks like the javascript for preventing such behaviour in forms is very simple so why not add another selector?
Line 634: https://github.com/twbs/bootstrap/blob/main/js/dist/dropdown.js#L634
The text was updated successfully, but these errors were encountered: