dialog aware prompt cursor (#20753)

pull/20763/head
Sebastian 2026-04-02 23:20:56 +02:00 committed by GitHub
parent bf26c08d51
commit 6e1400fc45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -442,8 +442,15 @@ export function Prompt(props: PromptProps) {
}) })
createEffect(() => { createEffect(() => {
if (props.visible !== false) input?.focus() if (!input || input.isDestroyed) return
if (props.visible === false) input?.blur() if (props.visible === false || dialog.stack.length > 0) {
input.blur()
return
}
// Slot/plugin updates can remount the background prompt while a dialog is open.
// Keep focus with the dialog and let the prompt reclaim it after the dialog closes.
input.focus()
}) })
createEffect(() => { createEffect(() => {