You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Wrap a form inside a shadcn dialog component.
Open the dialog and enter data into the form fields.
Close the dialog.
Reopen the dialog.
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:
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
Contributes
The text was updated successfully, but these errors were encountered: