fix(ui): bound option select lists to the trigger side and ellipsise labels

This commit is contained in:
sam committed 2026-10-18 23:45:28 +11:00
1 parent b28622368b
commit 003a36465e
1 file changed
+2 -2
+2 -2
View File
@@ -13,8 +13,8 @@ const emit = defineEmits<{ "update:modelValue": [string] }>();
<template>
<Select :model-value="modelValue === '' && options.some((o) => o.value === '') ? EMPTY : modelValue || undefined" :disabled="disabled" @update:model-value="emit('update:modelValue', $event === EMPTY ? '' : String($event))">
<SelectTrigger :size="size ?? 'sm'" :class="$props.class" v-bind="$attrs"><SelectValue :placeholder="placeholder" /></SelectTrigger>
<SelectContent>
<SelectItem v-for="option in options" :key="option.value" :value="option.value === '' ? EMPTY : option.value" :disabled="option.disabled">{{ option.label }}</SelectItem>
<SelectContent position="popper" class="max-w-[min(var(--reka-select-content-available-width),20rem)]">
<SelectItem v-for="option in options" :key="option.value" :value="option.value === '' ? EMPTY : option.value" :disabled="option.disabled" :title="option.label" class="*:[span]:last:min-w-0"><span class="truncate">{{ option.label }}</span></SelectItem>
</SelectContent>
</Select>
</template>