first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1,16 @@
import { isElementVisibleAndNotHidden } from '../focus';
import { getDocument } from './getDocument';
/**
* Gets the first visible element that matches the given selector
* @param selector - The selector to use to find potential visible elements
* @returns The first visible element that matches the selector, otherwise undefined
*
* @public
*/
export function getFirstVisibleElementFromSelector(selector) {
var doc = getDocument();
var elements = doc.querySelectorAll(selector);
// Iterate across the elements that match the selector and return the first visible/non-hidden element
return Array.from(elements).find(function (element) { var _a; return isElementVisibleAndNotHidden(element, (_a = doc.defaultView) !== null && _a !== void 0 ? _a : undefined); });
}
//# sourceMappingURL=getFirstVisibleElementFromSelector.js.map