v5: Dropdown - create a class/data-attribute selector to prevent closing dropdown-menu on click
Created by: jakubmuda
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.
<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