(element: Element, childElement?: Element)
| 60 | * @param element - Element to evaluate for display or visibility. |
| 61 | */ |
| 62 | export 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 | } |
no test coverage detected