-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3][UModal] Modal programatically opened using useModal
are not reseting its state after close
#2777
Comments
@noook Any hint on this? |
I’ve been testing this, and if we want to use a modal with useModal, we can’t do something like this:
|
using modal.isOpen.value or modal.close() programmatically does not trigger the update:open event in my testing |
I am having the same issue. Opening a modal with:
In v2, clicking outside the modal would reset it's state. When opening the modal again, the setup function would re-run. In v3, the setup function is not re-run, resulting in, e.g., the modal's form being filled with data from the previous modal's form. A workaround is closing the modal via Example:
|
My workaround is this: watch(modal.isOpen, (value) => {
if (!value) {
modal.reset()
}
}) |
Environment
Is this bug related to Nuxt or Vue?
Nuxt
Version
^3.0.0-alpha.9
Reproduction
https://ui3.nuxt.dev/components/modal#programmatic-usage
Description
Modal opened using
useModal
are not reseting its state after closeAdditional context
No response
Logs
The text was updated successfully, but these errors were encountered: