Skip to content

Commit

Permalink
Manually set option's selected prop (#5118)
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat authored Oct 31, 2024
1 parent c41e110 commit 66583ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/components/VSelectField/VSelectField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ const splitAttrs = computed(() => {
:aria-label="labelText"
>
<option v-if="blankText" disabled value="">{{ blankText }}</option>
<option v-for="choice in choices" :key="choice.key" :value="choice.key">
<option
v-for="choice in choices"
:key="choice.key"
:value="choice.key"
:selected="choice.key === selectValue ? true : undefined"
>
{{ choice.text }}
</option>
</select>
Expand Down

0 comments on commit 66583ed

Please sign in to comment.