shelving
Version:
Toolkit for using data in JavaScript.
17 lines (16 loc) • 780 B
TypeScript
import type { Nullish } from "../../util/null.js";
/** Focus on the first focusable element inside an element. */
export declare function focusFirstFocusable(el: Nullish<Element>): void;
/**
* Loop focus inside an element.
* - Attempts to blur outside the `from` element refocus back on the first focusable element inside the element.
*/
export declare function loopFocus(element: Nullish<Element>, nextTarget: Nullish<Element>): void;
/**
* Loop focus inside an element in response to a `blur` event.
* - Attempts to blur outside the `currentTarget` element refocus back on the first focusable element inside the element.
*/
export declare function eventLoopFocus({ currentTarget, relatedTarget }: {
currentTarget: Element;
relatedTarget: Element | null;
}): void;