mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-04-21 12:44:43 +00:00
src/tooltip.js Optimization
Util.findShadowRoot() returns either null or an object. It cannot return falsy, which allows this optimization.
This commit is contained in:
parent
28d9aaf670
commit
e4b62a920a
1 changed files with 1 additions and 3 deletions
|
|
@ -199,9 +199,7 @@ class Tooltip extends BaseComponent {
|
|||
|
||||
const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))
|
||||
const shadowRoot = findShadowRoot(this._element)
|
||||
const isInTheDom = shadowRoot === null ?
|
||||
this._element.ownerDocument.documentElement.contains(this._element) :
|
||||
shadowRoot.contains(this._element)
|
||||
const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue