MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / resolveFocusTarget

Function resolveFocusTarget

packages/core/src/widgets/useModalStack.ts:37–42  ·  view source on GitHub ↗
(props: Omit<ModalProps, "id">)

Source from the content-addressed store, hash-verified

35}
36
37function resolveFocusTarget(props: Omit<ModalProps, "id">): string | null {
38 if (typeof props.initialFocus === "string" && props.initialFocus.length > 0) {
39 return props.initialFocus;
40 }
41 return firstActionFocusTarget(props.actions);
42}
43
44export function useModalStack<State = void>(ctx: WidgetContext<State>): UseModalStack {
45 const [stack, setStack] = ctx.useState<readonly ModalStackEntry[]>(() => Object.freeze([]));

Callers 1

useModalStackFunction · 0.85

Calls 1

firstActionFocusTargetFunction · 0.85

Tested by

no test coverage detected