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
  • #17155
Closed
Open
Issue created Aug 20, 2015 by Administrator@rootContributor

Dropdown.prototype.toggle() should ignore defaultPrevented click events

Created by: jasonlo87

Ran into a simple looking issue w/ dropdown.js:

  1. Catch some event before BS and clear the .open class off a dropdown.
  2. PreventDefault on the event in the same handler.
  3. Dropdown.prototype.toggle erroneously tries to check for isDefaultPrevented() AFTER it's blasted away the original event and replaced it with a brand new one.

Result: Bootstrap re-toggles my dropdown back open.

Expected: Bootstrap respects my preventDefault and doesn't toggle the dropdown back open.

Here's a JSFiddle displaying the issue. It appears that the isDefaultPrevented() check should just be moved up a few lines (it also appears to occur like this in clearMenus() and maybe a few other methods in there): https://jsfiddle.net/9che8vz3/5/

Assignee
Assign to
Time tracking