Closed jeremiah-olisa closed 5 months ago
Hey @jeremiah-olisa .. this doesn't looks like a radix-vue
issue to me. The Form data was removed because the internal state of Form was clear when unmounted, this is expected.
And as the concept of shadcn-vue
, feel free to modify and wrap the component in your own way. 😁
Is there a unmount prop for dialog, that keeps it mounted??
Environment
Link to minimal reproduction
https://stackblitz.com/edit/nuxt-starter-ggrskg?file=README.md
Steps to reproduce
shadcn
dialog component.Describe the bug
Reproduction
https://stackblitz.com/edit/nuxt-starter-ggrskg?file=README.md
Describe the bug
Description
Issue Description:
When using a form wrapped inside a
shadcn
dialog component, the form data clears every time the dialog is closed and reopened. This behavior is not desired as it results in users losing their input data if the dialog is accidentally closed or if they navigate away and come back to the dialog.Steps to Reproduce:
shadcn
dialog component.Expected Behavior:
The form should retain its data when the dialog is closed and reopened.
Actual Behavior:
The form data clears each time the dialog is closed and reopened.
Proposed Solution:
Manage the form's state outside the dialog component to ensure that the form data persists. Here is an example implementation:
FormWrapper.vue
FormDialog.vue
This also happens on this form: https://stackblitz.com/edit/nuxt-starter-ggrskg?file=README.md
System Info
Expected behavior
No response
Context & Screenshots (if applicable)
No response