diff --git a/docs/components/tooltips.md b/docs/components/tooltips.md
index 7b3133c0e2..5518b7140b 100644
--- a/docs/components/tooltips.md
+++ b/docs/components/tooltips.md
@@ -245,7 +245,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
fallbackPlacement |
string | array |
- ['top', 'right', 'bottom', 'left'] |
+ 'flip' |
Allow to specify which position Popper will use on fallback. For more information refer to
Popper.js's behavior docs |
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 6d3db06ab9..f447ed4ced 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -70,7 +70,7 @@ const Tooltip = (($) => {
placement : 'top',
offset : 0,
container : false,
- fallbackPlacement : [AttachmentMap.TOP, AttachmentMap.RIGHT, AttachmentMap.BOTTOM, AttachmentMap.LEFT]
+ fallbackPlacement : 'flip'
}
const HoverState = {
@@ -334,8 +334,7 @@ const Tooltip = (($) => {
$(this.tip)
.one(Util.TRANSITION_END, complete)
.emulateTransitionEnd(Tooltip._TRANSITION_DURATION)
- }
- else {
+ } else {
complete()
}
}
@@ -668,7 +667,7 @@ const Tooltip = (($) => {
const tip = this.getTipElement()
const initConfigAnimation = this.config.animation
if (tip.getAttribute('x-placement') !== null) {
- return;
+ return
}
$(tip).removeClass(ClassName.FADE)
this.config.animation = false