Skip to content

Commit 40c4e7e

Browse files
committed
fix: getDisplayValue for custom options
1 parent 03c9b18 commit 40c4e7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Combobox/Combobox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ function getDisplayValue(selectedValue: string | null | undefined): string {
163163
const options = props.options.flatMap((opt) =>
164164
isGroup(opt) ? opt.options : opt,
165165
)
166-
const selectedOption = options.find((opt) => getValue(opt) === selectedValue)
166+
const selectedOption = options.find((opt) => getKey(opt) === selectedValue)
167167
return selectedOption ? getLabel(selectedOption) : selectedValue || ''
168168
}
169169
170170
const selectedOption = computed(() => {
171171
if (!internalModelValue.value) return null
172172
return allOptionsFlat.value.find(
173-
(opt) => getValue(opt) === internalModelValue.value,
173+
(opt) => getKey(opt) === internalModelValue.value,
174174
)
175175
})
176176

0 commit comments

Comments
 (0)