Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection box state is not updated when model has changed #356

Open
tkutz opened this issue Jun 3, 2022 · 4 comments
Open

Selection box state is not updated when model has changed #356

tkutz opened this issue Jun 3, 2022 · 4 comments

Comments

@tkutz
Copy link

tkutz commented Jun 3, 2022

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 tkutz changed the title Dialog state is not reset although model has changed Selection box state is not updated when model has changed Jun 3, 2022
@albanm
Copy link
Member

albanm commented Jun 3, 2022

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.

@tkutz
Copy link
Author

tkutz commented Jun 22, 2022

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?

@albanm
Copy link
Member

albanm commented Jun 22, 2022

It looks like another variant of #58

Once bound the model is only reactive one way.

@tkutz
Copy link
Author

tkutz commented Jun 23, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants