diff options
author | GeoSot <geo.sotis@gmail.com> | 2022-09-07 11:47:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 11:47:06 +0300 |
commit | 949456984aa21536afd35eddf7ea38b3648830a3 (patch) | |
tree | 8748970122c1d2de092b5d5f7140d0fd06e6e806 /js | |
parent | 7a7469b8ab3e86dc522d3cf030b307364b1ada0b (diff) |
Fix tooltip manual toggling (#37086)
partial regression of SHA: 9b9372e8ddd60413f3d9a582bd5481586d119d8d
Diffstat (limited to 'js')
-rw-r--r-- | js/src/tooltip.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 2c5f03a293..cb805dad84 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -111,7 +111,7 @@ class Tooltip extends BaseComponent { // Private this._isEnabled = true this._timeout = 0 - this._isHovered = false + this._isHovered = null this._activeTrigger = {} this._popper = null this._templateFactory = null @@ -246,14 +246,13 @@ class Tooltip extends BaseComponent { } const complete = () => { - const previousHoverState = this._isHovered - - this._isHovered = false EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN)) - if (previousHoverState) { + if (this._isHovered === false) { this._leave() } + + this._isHovered = false } this._queueCallback(complete, this.tip, this._isAnimated()) @@ -283,7 +282,7 @@ class Tooltip extends BaseComponent { this._activeTrigger[TRIGGER_CLICK] = false this._activeTrigger[TRIGGER_FOCUS] = false this._activeTrigger[TRIGGER_HOVER] = false - this._isHovered = false + this._isHovered = null // it is a trick to support manual triggering const complete = () => { if (this._isWithActiveTrigger()) { |