From e419d68f645a14045519a72427f48015e331859b Mon Sep 17 00:00:00 2001 From: Sylvain Marroufin Date: Tue, 24 May 2022 10:59:27 +0200 Subject: [PATCH] fix(Select): normalizedValue handling Object modelValue (#59) --- src/runtime/components/forms/Select.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/components/forms/Select.vue b/src/runtime/components/forms/Select.vue index e69c0f08..c0a60b0e 100644 --- a/src/runtime/components/forms/Select.vue +++ b/src/runtime/components/forms/Select.vue @@ -167,12 +167,13 @@ const normalizedOptionsWithPlaceholder = computed(() => { }) const normalizedValue = computed(() => { - const foundOption = normalizedOptionsWithPlaceholder.value.find(option => option.value === props.modelValue) + const normalizeModelValue = normalizeOption(props.modelValue) + const foundOption = normalizedOptionsWithPlaceholder.value.find(option => option[props.valueAttribute] === normalizeModelValue[props.valueAttribute]) if (!foundOption) { return '' } - return foundOption.value + return foundOption[props.valueAttribute] }) const selectClass = computed(() => {