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 shadcn's Form and Input components in a multi-step form where one step collects an old password and the next step collects a new password:
The new password field in step 2 automatically inherits the old password value from step 1
This happens even when using completely separate useForm instances for each step
The form state (via watch() or logging) shows the correct empty value, but the input field visually displays the old password
The field becomes impossible to edit when using two separate forms, but becomes editable(while retaining the oldPassword value) if a single form is used.
Reproduction
Create a multi-step form
Step 1: Form with password input for "current password"
Step 2: Form with password input for "new password"
After entering current password and moving to step 2, the new password field is pre-filled
Expected Behavior
The new password field in step 2 should be empty and fully editable, regardless of what was entered in step 1.
Current Workaround
Adding a dummy password input field before the form prevents this behavior.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Bug Description
When using shadcn's Form and Input components in a multi-step form where one step collects an old password and the next step collects a new password:
useForm
instances for each stepwatch()
or logging) shows the correct empty value, but the input field visually displays the old passwordReproduction
Expected Behavior
The new password field in step 2 should be empty and fully editable, regardless of what was entered in step 1.
Current Workaround
Adding a dummy password input field before the form prevents this behavior.
Code
Beta Was this translation helpful? Give feedback.
All reactions