1
0
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:
Rohit Sharma
2021-02-10 00:46:13 +05:30
committed by GitHub
parent 29e0c9dfa1
commit f7088e5d28
9 changed files with 99 additions and 16 deletions

View File

@@ -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)
}
}