I am facing an issue with Vue's reactivity when using a custom component in Quasar 2. Let me explain the scenario:
- The custom component includes two radio buttons and a select dropdown.
- Whenever the user changes one of the radio selections, the select dropdown is automatically reset to
null
.
Everything works as expected up to this point. However, there is a button that allows the user to overwrite all selections with new values for both the radio buttons and the select dropdown. The problem arises here: When this button is clicked, it replaces the v-model
for the component, triggering the watcher for the radio buttons and resetting the select dropdown.
For example:
If the user selects "Domestic" and "Option 1", then clicks the "Overwrite" button, the expected outcome should be "International" with "Option 2". But due to the watcher firing, "Option 2" gets reset.
You can view a demo on StackBlitz:
demo