fix(Modal): wait for transition to complete to reset state (#1618)

This commit is contained in:
Neil Richter
2024-04-05 14:07:51 +02:00
committed by GitHub
parent b62cd7905d
commit 2bdb5d2b42
3 changed files with 19 additions and 5 deletions

View File

@@ -24,11 +24,13 @@ function _useModal () {
isOpen.value = true
}
function close () {
async function close () {
if (!modalState) return
isOpen.value = false
}
function reset () {
modalState.value = {
component: 'div',
props: {}
@@ -53,6 +55,7 @@ function _useModal () {
return {
open,
close,
reset,
patch,
isOpen
}