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

Function hidesContents

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

Source from the content-addressed store, hash-verified

25}
26
27function hidesContents(element) {
28 const zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
29
30 // If the node is empty, this is good enough
31 if (zeroSize && !element.innerHTML) return true;
32
33 try {
34 // Otherwise we need to check some styles
35 const style = window.getComputedStyle(element);
36 const displayValue = style.getPropertyValue("display");
37 return zeroSize
38 ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style)
39 : displayValue === DISPLAY_NONE;
40 } catch (exception) {
41 // eslint-disable-next-line no-console
42 console.warn("Failed to inspect element style");
43 return false;
44 }
45}
46
47function visible(element) {
48 let parentElement = element;

Callers 1

visibleFunction · 0.85

Calls 1

isNotOverflowingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…