Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #32723
Closed
Open
Issue created Jan 07, 2021 by Administrator@rootContributor

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

Assignee
Assign to
Time tracking