vuetify-jsonschema-form icon indicating copy to clipboard operation
vuetify-jsonschema-form copied to clipboard

Selection box state is not updated when model has changed

Open tkutz opened this issue 2 years ago • 4 comments

In my scenario I use oneOf to have a selection box and to display different form elements based on this selection. The whole form is embedded inside of a v-dialog. However, if I change the underlying model, the selection does not change. This means in my concrete case, when I select something, close the dialog, change the model, and open the dialog again, it still shows the old value (while the model is different by now). It works with a simple manually created v-select though.

Is there any option I am missing, or is this just a bug?

tkutz avatar Jun 03 '22 12:06 tkutz

I don't fully understand the situation. Could you provide a codepen (the doc contains links to init codepens from the examples) ? Or at least a schema.

albanm avatar Jun 03 '22 12:06 albanm

Okay, I tried to reproduce the problem in a minimal example here: https://codepen.io/tkutz/pen/oNErLaW?editors=1011

When you klick the "toggle schema" button, the model changes, and the v-select gets updated, but the selection box created by vjsf does not update its value. Is there anything I am missing?

tkutz avatar Jun 22 '22 09:06 tkutz

It looks like another variant of https://github.com/koumoul-dev/vuetify-jsonschema-form/issues/58

Once bound the model is only reactive one way.

albanm avatar Jun 22 '22 14:06 albanm

Okay thanks, I managed to get around the issue with the <v-if> workaround mentioned in #58.

tkutz avatar Jun 23 '22 13:06 tkutz