1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

allow to pass popper.js configuration for tooltip/popover and dropdown

This commit is contained in:
Johann-S
2019-08-14 17:27:58 +02:00
committed by XhmikosR
parent b3cf60018c
commit f03c10a189
7 changed files with 107 additions and 31 deletions

View File

@@ -83,7 +83,8 @@ const Default = {
flip: true,
boundary: 'scrollParent',
reference: 'toggle',
display: 'dynamic'
display: 'dynamic',
popperConfig: null
}
const DefaultType = {
@@ -91,7 +92,8 @@ const DefaultType = {
flip: 'boolean',
boundary: '(string|element)',
reference: '(string|element)',
display: 'string'
display: 'string',
popperConfig: '(null|object)'
}
/**
@@ -339,7 +341,7 @@ class Dropdown {
}
_getPopperConfig() {
const popperConfig = {
let popperConfig = {
placement: this._getPlacement(),
modifiers: {
offset: this._getOffset(),
@@ -359,6 +361,13 @@ class Dropdown {
}
}
if (this._config.popperConfig) {
popperConfig = {
...popperConfig,
...this._config.popperConfig
}
}
return popperConfig
}