(actions: readonly VNode[] | undefined)
| 23 | }>; |
| 24 | |
| 25 | function 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 | |
| 37 | function resolveFocusTarget(props: Omit<ModalProps, "id">): string | null { |
| 38 | if (typeof props.initialFocus === "string" && props.initialFocus.length > 0) { |
no outgoing calls
no test coverage detected