aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorRyan Berliner <[email protected]>2021-03-06 23:57:23 +0200
committerXhmikosR <[email protected]>2021-03-16 07:48:50 +0200
commit6ef70b342c27445685715f51cfcafb719356870f (patch)
treecf56686a8ce25fe3b5f879256ea3b49326506192 /js/src
parentd491c29aa005177ef148c40d4b7b0a3decc7edef (diff)
downloadbootstrap-6ef70b342c27445685715f51cfcafb719356870f.tar.xz
bootstrap-6ef70b342c27445685715f51cfcafb719356870f.zip
prevent quick interactions from misplacing tooltips
Diffstat (limited to 'js/src')
-rw-r--r--js/src/tooltip.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index e9f9bfff1..857f72c8a 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -283,6 +283,10 @@ class Tooltip extends BaseComponent {
EventHandler.trigger(this._element, this.constructor.Event.INSERTED)
+ if (this._popper) {
+ this._popper.destroy()
+ }
+
this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))
tip.classList.add(CLASS_NAME_SHOW)
@@ -650,7 +654,7 @@ class Tooltip extends BaseComponent {
if (event) {
context._activeTrigger[
event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER
- ] = false
+ ] = context._element.contains(event.relatedTarget)
}
if (context._isWithActiveTrigger()) {