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

Function firstActionFocusTarget

packages/core/src/widgets/useModalStack.ts:25–35  ·  view source on GitHub ↗
(actions: readonly VNode[] | undefined)

Source from the content-addressed store, hash-verified

23}>;
24
25function firstActionFocusTarget(actions: readonly VNode[] | undefined): string | null {
26 if (!actions) return null;
27 for (const action of actions) {
28 if (action.kind !== "button") continue;
29 const id = (action.props as { id?: unknown }).id;
30 if (typeof id === "string" && id.length > 0) {
31 return id;
32 }
33 }
34 return null;
35}
36
37function resolveFocusTarget(props: Omit<ModalProps, "id">): string | null {
38 if (typeof props.initialFocus === "string" && props.initialFocus.length > 0) {

Callers 1

resolveFocusTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected