Skip to content

Commit 31d59b2

Browse files
beekermememediasbruno
authored andcommitted
Adding a check to see if the element is a prototype of Element before getting the computed style
1 parent 827796d commit 31d59b2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/helpers/tabbable.js

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ function hidesContents(element) {
1818
// If the node is empty, this is good enough
1919
if (zeroSize && !element.innerHTML) return true;
2020

21+
// if the element is not of type Element e.g. shadowRoot
22+
// we cannot go any further
23+
if (!element.isPrototypeOf(Element)) {
24+
return false;
25+
}
26+
2127
// Otherwise we need to check some styles
2228
const style = window.getComputedStyle(element);
2329
return zeroSize

0 commit comments

Comments
 (0)