Skip to content

Commit 9494569

Browse files
authored
Fix tooltip manual toggling (#37086)
partial regression of SHA: 9b9372e
1 parent 7a7469b commit 9494569

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

js/src/tooltip.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Tooltip extends BaseComponent {
111111
// Private
112112
this._isEnabled = true
113113
this._timeout = 0
114-
this._isHovered = false
114+
this._isHovered = null
115115
this._activeTrigger = {}
116116
this._popper = null
117117
this._templateFactory = null
@@ -246,14 +246,13 @@ class Tooltip extends BaseComponent {
246246
}
247247

248248
const complete = () => {
249-
const previousHoverState = this._isHovered
250-
251-
this._isHovered = false
252249
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))
253250

254-
if (previousHoverState) {
251+
if (this._isHovered === false) {
255252
this._leave()
256253
}
254+
255+
this._isHovered = false
257256
}
258257

259258
this._queueCallback(complete, this.tip, this._isAnimated())
@@ -283,7 +282,7 @@ class Tooltip extends BaseComponent {
283282
this._activeTrigger[TRIGGER_CLICK] = false
284283
this._activeTrigger[TRIGGER_FOCUS] = false
285284
this._activeTrigger[TRIGGER_HOVER] = false
286-
this._isHovered = false
285+
this._isHovered = null // it is a trick to support manual triggering
287286

288287
const complete = () => {
289288
if (this._isWithActiveTrigger()) {

0 commit comments

Comments
 (0)