mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 23:11:43 +01:00
fix(Select/SelectMenu): prevent empty string display when multiple
Regression of 7df7ee336a
This commit is contained in:
@@ -225,9 +225,10 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.selectMenu |
|
||||
buttonGroup: orientation.value
|
||||
}))
|
||||
|
||||
function displayValue(value: GetItemValue<T, VK> | GetItemValue<T, VK>[]): string {
|
||||
function displayValue(value: GetItemValue<T, VK> | GetItemValue<T, VK>[]): string | undefined {
|
||||
if (props.multiple && Array.isArray(value)) {
|
||||
return value.map(v => displayValue(v)).filter(Boolean).join(', ')
|
||||
const values = value.map(v => displayValue(v)).filter(Boolean)
|
||||
return values?.length ? values.join(', ') : undefined
|
||||
}
|
||||
|
||||
if (!props.valueKey) {
|
||||
|
||||
Reference in New Issue
Block a user