mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-08 22:56:46 +02:00
12
js/dist/dropdown.js
vendored
12
js/dist/dropdown.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap dropdown.js v5.2.0 (https://getbootstrap.com/)
|
||||
* Bootstrap dropdown.js v5.2.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.2.0): dropdown.js
|
||||
* Bootstrap (v5.2.1): dropdown.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -107,8 +107,9 @@
|
||||
super(element, config);
|
||||
this._popper = null;
|
||||
this._parent = this._element.parentNode; // dropdown wrapper
|
||||
// todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.2/forms/input-group/
|
||||
|
||||
this._menu = SelectorEngine__default.default.findOne(SELECTOR_MENU, this._parent);
|
||||
this._menu = SelectorEngine__default.default.next(this._element, SELECTOR_MENU)[0] || SelectorEngine__default.default.prev(this._element, SELECTOR_MENU)[0];
|
||||
this._inNavbar = this._detectNavbar();
|
||||
} // Getters
|
||||
|
||||
@@ -424,8 +425,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
const getToggleButton = SelectorEngine__default.default.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode);
|
||||
event.preventDefault(); // todo: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.2/forms/input-group/
|
||||
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine__default.default.prev(this, SELECTOR_DATA_TOGGLE)[0] || SelectorEngine__default.default.next(this, SELECTOR_DATA_TOGGLE)[0];
|
||||
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
||||
|
||||
if (isUpOrDownEvent) {
|
||||
|
Reference in New Issue
Block a user