gitea push

This commit is contained in:
2026-05-09 12:19:29 -06:00
parent 06113c95b8
commit 429461e985
1481 changed files with 74306 additions and 52475 deletions
+6 -6
View File
@@ -411,21 +411,21 @@ export function getNextElement(elements, location, condition) {
} while ((!_el || _el.offsetParent == null || !(condition?.(_el) ?? true)) && idx < elements.length && idx >= 0);
return _el;
}
export function focusChild(el, location) {
export function focusChild(el, location, options) {
const focusable = focusableChildren(el);
if (location == null) {
if (el === document.activeElement || !el.contains(document.activeElement)) {
focusable[0]?.focus();
focusable[0]?.focus(options);
}
} else if (location === 'first') {
focusable[0]?.focus();
focusable[0]?.focus(options);
} else if (location === 'last') {
focusable.at(-1)?.focus();
focusable.at(-1)?.focus(options);
} else if (typeof location === 'number') {
focusable[location]?.focus();
focusable[location]?.focus(options);
} else {
const _el = getNextElement(focusable, location);
if (_el) _el.focus();else focusChild(el, location === 'next' ? 'first' : 'last');
if (_el) _el.focus();else focusChild(el, location === 'next' ? 'first' : 'last', options);
}
}
export function isEmpty(val) {