@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
16 lines (15 loc) • 461 B
TypeScript
/**
* Save the current active element.
*/
export declare function saveActiveElement(): void;
/**
* Trap tab navigation inside the given element.
*
* @param {HTMLElement} element The element in which to trap the tabulations.
* @param {KeyboardEvent} event The keydown or keyup event.
*/
export declare function trapFocus(element: HTMLElement, event: KeyboardEvent): void;
/**
* Untrap the tab navigation.
*/
export declare function untrapFocus(): void;