fix height combobox (virtual list)
This commit is contained in:
@@ -121,7 +121,12 @@ export function ComboboxAdvanced({
|
|||||||
value={inputValue}
|
value={inputValue}
|
||||||
onValueChange={setInputValue}
|
onValueChange={setInputValue}
|
||||||
/>
|
/>
|
||||||
<VirtualList height={300} data={data} itemHeight={32} itemKey="value">
|
<VirtualList
|
||||||
|
height={Math.min(items.length * 32, 300)}
|
||||||
|
data={data}
|
||||||
|
itemHeight={32}
|
||||||
|
itemKey="value"
|
||||||
|
>
|
||||||
{renderItem}
|
{renderItem}
|
||||||
</VirtualList>
|
</VirtualList>
|
||||||
</Command>
|
</Command>
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export function Combobox<T extends string>({
|
|||||||
<CommandEmpty>Nothing selected</CommandEmpty>
|
<CommandEmpty>Nothing selected</CommandEmpty>
|
||||||
)}
|
)}
|
||||||
<VirtualList
|
<VirtualList
|
||||||
height={300}
|
height={Math.min(items.length * 32, 300)}
|
||||||
data={items.filter((item) => {
|
data={items.filter((item) => {
|
||||||
if (search === '') return true;
|
if (search === '') return true;
|
||||||
return item.label.toLowerCase().includes(search.toLowerCase());
|
return item.label.toLowerCase().includes(search.toLowerCase());
|
||||||
|
|||||||
Reference in New Issue
Block a user