diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 103524b8b49f..63a30cf2fbd2 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -51,7 +51,7 @@ const DefaultType = { selector: '(string|boolean)', placement: '(string|function)', container: '(string|element|boolean)', - fallbackPlacements: '(null|array)', + fallbackPlacements: 'array', boundary: '(string|element)', customClass: '(string|function)', sanitize: 'boolean', @@ -81,7 +81,7 @@ const Default = { selector: false, placement: 'top', container: false, - fallbackPlacements: null, + fallbackPlacements: ['top', 'right', 'bottom', 'left'], boundary: 'clippingParents', customClass: '', sanitize: true, @@ -466,22 +466,16 @@ class Tooltip extends BaseComponent { // Private _getPopperConfig(attachment) { - const flipModifier = { - name: 'flip', - options: { - altBoundary: true, - fallbackPlacements: ['top', 'right', 'bottom', 'left'] - } - } - - if (this.config.fallbackPlacements) { - flipModifier.options.fallbackPlacements = this.config.fallbackPlacements - } - const defaultBsConfig = { placement: attachment, modifiers: [ - flipModifier, + { + name: 'flip', + options: { + altBoundary: true, + fallbackPlacements: this.config.fallbackPlacements + } + }, { name: 'preventOverflow', options: { diff --git a/site/content/docs/5.0/components/popovers.md b/site/content/docs/5.0/components/popovers.md index 0b468833d42d..0c6118790c60 100644 --- a/site/content/docs/5.0/components/popovers.md +++ b/site/content/docs/5.0/components/popovers.md @@ -249,9 +249,9 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt
fallbackPlacements
'flip'
['top', 'right', 'bottom', 'left']
fallbackPlacements
null
['top', 'right', 'bottom', 'left']