Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to reset a select field based on a value of another select field. I am able to effectively reset the form value, but the component itself keeps showing the value it was set before. I have verified this by console.logging the field values. Here is a .gif to make it obvious:
The idea is that if the first field on the left has no selection or the first value (No spazzole) is selected, the other two fields must be disabled and reset to
undefined
. The disabling part works and the values even get reset toundefined
, but I don't know how to reset the select fields shown value back to placeholder.I am using
shadcn
components, so all the form logic is provided byreact-hook-forms
.Please see the Select component below. I reset the field on
Select onValueChange
function:Here is also the
Form
component where theSelectField
components are created. I removed all markup that isn't related to theSelectFields
:Beta Was this translation helpful? Give feedback.
All reactions