In my Vue app, I have a select element that dynamically shows or hides options based on the user's previous selections. For example:
<select id='animal' v-model='values.animal.selected'>
<option value='cat' v-if='legs == 4'>Cat</option>
<option value='dog' v-if='legs == 4'>Dog</option>
<option value='bird' v-if='legs == 2 && wings == 2'>Bird</option>
<option value='snake' v-if='!legs'>Snake</option>
</select>
While this setup successfully displays and hides options based on changing criteria, the selected option sometimes remains hidden even when it should switch to an available option. Is it feasible to automatically update the selected value of the select element when the options change, such as setting it to the first visible option?