Skip to content

Commit cbf94a7

Browse files
committed
fix(SelectMenu): check null model value
Resolves #1421
1 parent 446280c commit cbf94a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/components/forms/SelectMenu.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,16 @@ export default defineComponent({
362362
} else {
363363
return null
364364
}
365-
} else {
365+
} else if (props.modelValue) {
366366
if (props.valueAttribute) {
367367
const option = props.options.find(option => option[props.valueAttribute] === props.modelValue)
368368
return option ? option[props.optionAttribute] : null
369369
} else {
370370
return ['string', 'number'].includes(typeof props.modelValue) ? props.modelValue : props.modelValue[props.optionAttribute]
371371
}
372372
}
373+
374+
return null
373375
})
374376
375377
const selectClass = computed(() => {

0 commit comments

Comments
 (0)