fix(desktop): focus prompt input after dialog close
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user