diff options
| author | Adam <[email protected]> | 2025-12-16 15:25:00 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-16 15:25:00 -0600 |
| commit | 99680baf83cd494a97b4db115ba2f1a2a4f7ce06 (patch) | |
| tree | 84e7ac2a78fe83af7a455a9f0af59d06fb1f9d55 /packages/ui/src/context | |
| parent | 9aa5460a0e1292dbfa6abcf944e8f5982618f3ca (diff) | |
| download | opencode-99680baf83cd494a97b4db115ba2f1a2a4f7ce06.tar.gz opencode-99680baf83cd494a97b4db115ba2f1a2a4f7ce06.zip | |
fix(desktop): focus prompt input after dialog close
Diffstat (limited to 'packages/ui/src/context')
| -rw-r--r-- | packages/ui/src/context/dialog.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/ui/src/context/dialog.tsx b/packages/ui/src/context/dialog.tsx index 71fc63806..56be9ee47 100644 --- a/packages/ui/src/context/dialog.tsx +++ b/packages/ui/src/context/dialog.tsx @@ -33,6 +33,10 @@ function init() { }, close() { active()?.onClose?.() + if (!active()?.onClose) { + const promptInput = document.querySelector("[data-component=prompt-input]") as HTMLElement + promptInput?.focus() + } setActive(undefined) }, show(element: DialogElement, owner: Owner, onClose?: () => void) { @@ -48,7 +52,6 @@ function init() { open={true} onOpenChange={(open) => { if (!open) { - console.log("closing") result.close() } }} |
