Closed anis closed 2 years ago
The value of a radio field is kept on unmount, even though the option keepValues is set to false. I expect a Form to not keep the value of a hidden radio field.
keepValues
false
Create a Form with a radio Field:
<Form> <Field type="radio" name="demo" value="1" /> <Field type="radio" name="demo" value="2" /> </Form>
After selecting one of the values, hide the Field somehow (by clicking on a button for instance):
<Field v-if="showField" type="radio" ... /> ... <button @click="showField = false" />
When the Field is unmounted, see how its value is still kept by the Form
Using the demo link you may follow the steps below:
question1
question2
Vue.js 3.x and vee-validate 4.x
No response
https://codesandbox.io/embed/vigorous-bohr-dh6uyo?fontsize=14&hidenavigation=1&theme=dark
Thank you for reporting this, I found the issue and will tag a new release shortly.
What happened?
The value of a radio field is kept on unmount, even though the option
keepValues
is set tofalse
. I expect a Form to not keep the value of a hidden radio field.Reproduction steps
Create a Form with a radio Field:
After selecting one of the values, hide the Field somehow (by clicking on a button for instance):
When the Field is unmounted, see how its value is still kept by the Form
Using the demo link you may follow the steps below:
question1
andquestion2
are displayedquestion2
disappears, butquestion1
is kept even though the field has been unmountedVersion
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://codesandbox.io/embed/vigorous-bohr-dh6uyo?fontsize=14&hidenavigation=1&theme=dark
Code of Conduct