From b049feb09fce68bca44dbc1116d39a8f9a2d314b Mon Sep 17 00:00:00 2001 From: Steve Matney Date: Fri, 22 Oct 2021 14:02:39 -0600 Subject: [PATCH] Update src/helpers/tabbable.js Co-authored-by: Bruno Dias --- src/helpers/tabbable.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/helpers/tabbable.js b/src/helpers/tabbable.js index 062216e0..ff462c22 100644 --- a/src/helpers/tabbable.js +++ b/src/helpers/tabbable.js @@ -35,10 +35,7 @@ function hidesContents(element) { function visible(element) { let parentElement = element; - let rootNode = - typeof element.getRootNode === "function" - ? element.getRootNode() - : undefined; + let rootNode = element.getRootNode && element.getRootNode(); while (parentElement) { if (parentElement === document.body) break; if (rootNode && parentElement === rootNode) parentElement = rootNode.host;