The issue is that formData is refreshed only after the input type has changes which means it might receive an incorrect default value type. A solution is to make the default value a computed which makes it always aligns with the selected type. Here's one way of fixing it.
This isn't really an issue with Vueform so I'm moving this to discussions.
","upvoteCount":1,"url":"https://github.com/vueform/vueform/discussions/490#discussioncomment-14728210"}}}-
EnvironmentVite 4.4.5 Reproductionhttps://stackblitz.com/edit/github-bwjmhwik-2l1jekvb Describe the bugI 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 Repro the bug:
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 contextNo response Logs |
Beta Was this translation helpful? Give feedback.
-
|
The issue is that This isn't really an issue with Vueform so I'm moving this to discussions. |
Beta Was this translation helpful? Give feedback.
The issue is that
formDatais refreshed only after the input type has changes which means it might receive an incorrect default value type. A solution is to make the default value a computed which makes it always aligns with the selected type. Here's one way of fixing it.This isn't really an issue with Vueform so I'm moving this to discussions.