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