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
  • #37111
Closed
Open
Issue created Sep 09, 2022 by XhmikosR@XhmikosRContributor3 of 3 checklist items completed3/3 checklist items

v5.2.1 dropdown TypeError

Prerequisites

  • I have searched for duplicate or closed issues
  • I have validated any HTML to avoid common problems
  • I have read the contributing guidelines

Describe the issue

<div class="dropdown">
  <ul class="dropdown-menu">
    <li class="d-block d-lg-none">
      <h6 class="dropdown-header text-wrap">
        WHATEVER
      </h6>
    </li>
    <li>
      <hr class="dropdown-divider d-block d-md-none">
    </li>
    <li>
      <button class="dropdown-item" type="button">Logout</button>
    </li>
  </ul> <!-- .dropdown-menu -->
</div> <!-- .dropdown -->
Uncaught TypeError: this._menu is undefined
    _isShown bootstrap.bundle.js:4040
    toggle bootstrap.bundle.js:3910
    <anonymous> bootstrap.bundle.js:4241
    handler bootstrap.bundle.js:397
    invokeTask zone.js:406
    runTask zone.js:178
    invokeTask zone.js:487
    invokeTask zone.js:1661
    globalCallback zone.js:1704
    globalZoneAwareCaptureCallback zone.js:1729

which points to:

_isShown() {
  return this._menu.classList.contains(CLASS_NAME_SHOW$6);
}

Same markup works with 5.2.0.

Reduced test cases

See above

What operating system(s) are you seeing the problem on?

Windows, Android

What browser(s) are you seeing the problem on?

Chrome, Firefox

What version of Bootstrap are you using?

v5.2.1


Seems like https://github.com/twbs/bootstrap/commit/337068f8b1044004f4b9abfffbb433694ae87993 is to blame

Assignee
Assign to
Time tracking