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