summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/context
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src/context')
-rw-r--r--packages/ui/src/context/dialog.tsx5
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()
}
}}