mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-26 13:29:06 +02:00
Add function type for popperConfig
option (#32882)
* Add function type for `popperConfig` option * Update .bundlewatch.config.json * copy edits Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Mark Otto <markdotto@gmail.com>
This commit is contained in:
@@ -58,7 +58,7 @@ const DefaultType = {
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
allowList: 'object',
|
||||
popperConfig: '(null|object)'
|
||||
popperConfig: '(null|object|function)'
|
||||
}
|
||||
|
||||
const AttachmentMap = {
|
||||
@@ -490,7 +490,7 @@ class Tooltip extends BaseComponent {
|
||||
}
|
||||
|
||||
_getPopperConfig(attachment) {
|
||||
const defaultBsConfig = {
|
||||
const defaultBsPopperConfig = {
|
||||
placement: attachment,
|
||||
modifiers: [
|
||||
{
|
||||
@@ -533,8 +533,8 @@ class Tooltip extends BaseComponent {
|
||||
}
|
||||
|
||||
return {
|
||||
...defaultBsConfig,
|
||||
...this.config.popperConfig
|
||||
...defaultBsPopperConfig,
|
||||
...(typeof this.config.popperConfig === 'function' ? this.config.popperConfig(defaultBsPopperConfig) : this.config.popperConfig)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user