MCPcopy Create free account
hub / github.com/reactjs/react-modal / visible

Function visible

src/helpers/tabbable.js:46–60  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

44}
45
46function visible(element) {
47 let parentElement = element;
48 let rootNode = element.getRootNode && element.getRootNode();
49 while (parentElement) {
50 if (parentElement === document.body) break;
51
52 // if we are not hidden yet, skip to checking outside the Web Component
53 if (rootNode && parentElement === rootNode)
54 parentElement = rootNode.host.parentNode;
55
56 if (hidesContents(parentElement)) return false;
57 parentElement = parentElement.parentNode;
58 }
59 return true;
60}
61
62function focusable(element, isTabIndexNotNaN) {
63 const nodeName = element.nodeName.toLowerCase();

Callers 1

focusableFunction · 0.85

Calls 1

hidesContentsFunction · 0.85

Tested by

no test coverage detected