this.tip.remove()
}
- if (this._popper) {
- this._popper.destroy()
- }
-
+ this._disposePopper()
super.dispose()
}
return
}
+ // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`
+ // This will be removed later in favor of a `setContent` method
+ if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
+ this._disposePopper()
+ this.tip.remove()
+ this.tip = null
+ }
+
const tip = this.getTipElement()
const tipId = getUID(this.constructor.NAME)
this._element.removeAttribute('aria-describedby')
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN)
- if (this._popper) {
- this._popper.destroy()
- this._popper = null
- }
+ this._disposePopper()
}
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE)
this._addAttachmentClass(this._getAttachment(state.placement))
}
+ _disposePopper() {
+ if (this._popper) {
+ this._popper.destroy()
+ this._popper = null
+ }
+ }
+
// Static
static jQueryInterface(config) {