Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2021-10-10 15:09:57 +0300
committerXhmikosR <xhmikosr@gmail.com>2021-12-01 18:10:39 +0300
commitfb5921dec49da37e9bab745d7319037e89e2f31e (patch)
tree2f9eb720f5ad7607cdeb5b70a0388c37cd3e402f /js/src/dropdown.js
parent137b3249304b9ffeb76c72b7094ae7f170993016 (diff)
Dropdown: Merge `display='static'` & `isNavbar` functionality activating static popper with no styles attached
Diffstat (limited to 'js/src/dropdown.js')
-rw-r--r--js/src/dropdown.js19
1 files changed, 5 insertions, 14 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index 06f69af7be..d5c42b012d 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -133,12 +133,8 @@ class Dropdown extends BaseComponent {
}
const parent = getElementFromSelector(this._element) || this._element.parentNode
- // Totally disable Popper for Dropdowns in Navbar
- if (this._inNavbar) {
- Manipulator.setDataAttribute(this._menu, 'popper', 'none')
- } else {
- this._createPopper(parent)
- }
+
+ this._createPopper(parent)
// If this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children;
@@ -246,13 +242,7 @@ class Dropdown extends BaseComponent {
}
const popperConfig = this._getPopperConfig()
- const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false)
-
this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)
-
- if (isDisplayStatic) {
- Manipulator.setDataAttribute(this._menu, 'popper', 'static')
- }
}
_isShown(element = this._element) {
@@ -319,8 +309,9 @@ class Dropdown extends BaseComponent {
}]
}
- // Disable Popper if we have a static display
- if (this._config.display === 'static') {
+ // Disable Popper if we have a static display or Dropdown is in Navbar
+ if (this._inNavbar || this._config.display === 'static') {
+ Manipulator.setDataAttribute(this._menu, 'popper', 'static') // todo:v6 remove
defaultBsPopperConfig.modifiers = [{
name: 'applyStyles',
enabled: false