(props: Omit<ModalProps, "id">)
| 35 | } |
| 36 | |
| 37 | function 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 | |
| 44 | export function useModalStack<State = void>(ctx: WidgetContext<State>): UseModalStack { |
| 45 | const [stack, setStack] = ctx.useState<readonly ModalStackEntry[]>(() => Object.freeze([])); |
no test coverage detected