dialog aware prompt cursor (#20753)
This commit is contained in:
@@ -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(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user