mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-13 17:14:04 +02:00
Fix tooltip manual toggling (#37086)
partial regression of SHA: 9b9372e8dd
This commit is contained in:
@@ -111,7 +111,7 @@ class Tooltip extends BaseComponent {
|
|||||||
// Private
|
// Private
|
||||||
this._isEnabled = true
|
this._isEnabled = true
|
||||||
this._timeout = 0
|
this._timeout = 0
|
||||||
this._isHovered = false
|
this._isHovered = null
|
||||||
this._activeTrigger = {}
|
this._activeTrigger = {}
|
||||||
this._popper = null
|
this._popper = null
|
||||||
this._templateFactory = null
|
this._templateFactory = null
|
||||||
@@ -246,14 +246,13 @@ class Tooltip extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
const previousHoverState = this._isHovered
|
|
||||||
|
|
||||||
this._isHovered = false
|
|
||||||
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))
|
EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))
|
||||||
|
|
||||||
if (previousHoverState) {
|
if (this._isHovered === false) {
|
||||||
this._leave()
|
this._leave()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._isHovered = false
|
||||||
}
|
}
|
||||||
|
|
||||||
this._queueCallback(complete, this.tip, this._isAnimated())
|
this._queueCallback(complete, this.tip, this._isAnimated())
|
||||||
@@ -283,7 +282,7 @@ class Tooltip extends BaseComponent {
|
|||||||
this._activeTrigger[TRIGGER_CLICK] = false
|
this._activeTrigger[TRIGGER_CLICK] = false
|
||||||
this._activeTrigger[TRIGGER_FOCUS] = false
|
this._activeTrigger[TRIGGER_FOCUS] = false
|
||||||
this._activeTrigger[TRIGGER_HOVER] = false
|
this._activeTrigger[TRIGGER_HOVER] = false
|
||||||
this._isHovered = false
|
this._isHovered = null // it is a trick to support manual triggering
|
||||||
|
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
if (this._isWithActiveTrigger()) {
|
if (this._isWithActiveTrigger()) {
|
||||||
|
Reference in New Issue
Block a user