2
0

🚸 Remove 50 select items initial hard limit

Closes #1348
This commit is contained in:
Baptiste Arnaud
2024-03-13 10:20:52 +01:00
parent eaaa840cbf
commit cbfc980cf5

View File

@@ -69,17 +69,15 @@ export const Select = <T extends Item>({
const inputRef = useRef<HTMLInputElement>(null) const inputRef = useRef<HTMLInputElement>(null)
const { ref: parentModalRef } = useParentModal() const { ref: parentModalRef } = useParentModal()
const filteredItems = ( const filteredItems = isTouched
isTouched ? [
? [ ...(items ?? []).filter((item) =>
...(items ?? []).filter((item) => getItemLabel(item)
getItemLabel(item) .toLowerCase()
.toLowerCase() .includes((inputValue ?? '').toLowerCase())
.includes((inputValue ?? '').toLowerCase()) ),
), ]
] : items ?? []
: items ?? []
).slice(0, 50)
const closeDropdown = () => { const closeDropdown = () => {
onClose() onClose()