hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.27k stars 287 forks source link

feat: add maxOptionsToDisplay option to improve autocomplete performance on long lists #636

Open JL102 opened 8 months ago

JL102 commented 8 months ago

When using autocomplete with lists > 50ish in length, the creation of Svelte/DOM components in the list starts to become a performance bottleneck. It starts to become slow enough for an annoying user experience past 100. Since SMUI doesn't have any sort of virtual list component that I know of, simply limiting the number of rendered results is what I believe is a simple yet effective solution to the problem. In cases where you have a really long list but MUST render them all, then they can just keep the default value and let all the list items render.