aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'js/src')
-rw-r--r--js/src/tooltip.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 5cf56ce6e..db626048f 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -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