-
-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Environment
Vite 4.4.5
Vueform 1.9.6
Vue 3.3.4
npm
Reproduction
https://stackblitz.com/edit/github-bwjmhwik-2l1jekvb
Describe the bug
I have a form that dynamically adds questions based on given answers. The first question field has the name "0". Some answers to that question will add a new question with the name "0_0". Sometimes the type of "0_0" will be a string and sometimes an array. When the type changes Vueform makes a mistake and puts the wrong value in or just completely removes the field.
Choose Friend then John. "0_0" will be a string
Choose Family then Brother, Sister. "0_0" will be an array of 2 items
Repro the bug:
- Choose Friend then John. Then choose Family then Brother. "0_0" will be a bool type when it should be an array.
- Choose Other. Choose Family then Brother. "0_0" is absent from the form data
- Choose Family then Brother. Choose Other. "0_0" is an array type with "Brother" inside but the textinput has "Brother". "0_0" should be a string
- Choose Other. Choose Friend. "0_0" is absent from the form data
These scenarios demonstrate some strange unexpected behavior. It looks like when the field type changes vueform is not detecting the right thing to do and tries to apply the value regardless of type.
Additional context
No response