@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
14 lines (13 loc) • 909 B
TypeScript
import type { FocusTrap, Options } from "focus-trap";
import type { SetReturnType } from "type-fest";
export type FocusTrapOptions = Pick<Options, "allowOutsideClick" | "initialFocus" | "returnFocusOnDeactivate">
& {
/** Additional elements to include in the focus trap. This is useful for including elements that may have related parts rendered outside the main focus-trap element. */
extraContainers: Parameters<FocusTrap["updateContainerElements"]>[0];
/**
* By default, when the focus trap is deactivated, focus will return to the element that was focused before the trap was activated. This option allows customizing that behavior.
*
* Returning undefined will use the default behavior of returning focus to the element focused before activation.
*/
setReturnFocus?: Options["setReturnFocus"] | undefined | SetReturnType<Extract<Options["setReturnFocus"], Function>, undefined>;
};