MCPcopy
hub / github.com/reactjs/react-modal / visible

Function visible

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

Source from the content-addressed store, hash-verified

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

Callers 1

focusableFunction · 0.85

Calls 1

hidesContentsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…