MCPcopy Index your code
hub / github.com/adobe/react-spectrum / isElementVisible

Function isElementVisible

packages/react-aria/src/utils/isElementVisible.ts:62–76  ·  view source on GitHub ↗
(element: Element, childElement?: Element)

Source from the content-addressed store, hash-verified

60 * @param element - Element to evaluate for display or visibility.
61 */
62export function isElementVisible(element: Element, childElement?: Element): boolean {
63 if (supportsCheckVisibility) {
64 return (
65 element.checkVisibility({visibilityProperty: true}) &&
66 !element.closest('[data-react-aria-prevent-focus]')
67 );
68 }
69
70 return (
71 element.nodeName !== '#comment' &&
72 isStyleVisible(element) &&
73 isAttributeVisible(element, childElement) &&
74 (!element.parentElement || isElementVisible(element.parentElement, element))
75 );
76}

Callers 2

isFocusableFunction · 0.90
isTabbableFunction · 0.90

Calls 2

isStyleVisibleFunction · 0.85
isAttributeVisibleFunction · 0.85

Tested by

no test coverage detected