MCPcopy
hub / github.com/microsoft/SandDance / isElementVisible

Function isElementVisible

docs/app/js/sanddance-app.js:24662–24671  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

24660 return null;
24661}
24662function isElementVisible(element) {
24663 // If the element is not valid, return false.
24664 if (!element || !element.getAttribute) return false;
24665 var visibilityAttribute = element.getAttribute(IS_VISIBLE_ATTRIBUTE);
24666 // If the element is explicitly marked with the visibility attribute, return that value as boolean.
24667 if (visibilityAttribute !== null && visibilityAttribute !== undefined) return visibilityAttribute === "true";
24668 // Fallback to other methods of determining actual visibility.
24669 return element.offsetHeight !== 0 || element.offsetParent !== null || // eslint-disable-next-line @typescript-eslint/no-explicit-any
24670 element.isVisible === true; // used as a workaround for testing.
24671}
24672function isElementTabbable(element, checkTabIndex) {
24673 // If this element is null or is disabled, it is not considered tabbable.
24674 if (!element || element.disabled) return false;

Callers 3

getPreviousElementFunction · 0.85
getNextElementFunction · 0.85
getFocusableByIndexPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected