#Select component - 'mousedown' handler took ++++ms
14 messages · Page 1 of 1 (latest)
As you can see, the value changes instantly. It's just that the Select dropdown takes too long to close
additional context: i am rendering 500 rows of data
Use limit prop with searchable select to prevent excessive items rendering
ohh sorry im not talking about the data prop of Select.
I use Select to change my filters. The data then returns 500 items based on that filter. I tried commenting out the data rendering part and i no longer have the issue :/ Is this an optimization problem on my end? or there's an actual performance issue with the select dropdown if there are lots of data rendered?
mousedown triggers items rendering in dropdown
here's a quick demo
Use limit prop with searchable select to prevent excessive items rendering
this is not a searchable select
i added this code just to see if there's a problem with the component
const [isPending, startTransition] = useTransition();
console.log({ isPending });
return (
...
<Select
value={value}
onChange={(newValue) => {
startTransition(() => {
setValue(newValue);
})
}}
/>
...
);
The dropdown closes instantly now, but the value change still has delay
Yes, that is why I advise to make select searchable and set limit prop to avoid performance issues.