We need a way to restrict the number of results rendered on the Select/Async select components.
This is extremely useful if the number of options is too high and if someone wants to limit the items being displayed to improve performance.
Add maxOptions optional prop for Select/AsyncSelect which takes a number.
I think the follow up question would be how to determine what options shall be filtered? I think you may be asking for the incremental loading of the options.
Not really! Say for example you have an AsyncSelect component, and your search returns 10,000 results. You need a mechanism to restrict the number of items rendered for performance reasons.
It may not make a lot of sense for Select, but I think it is useful to have this prop available for AsyncSelect.
Hi @Chopinsky @nithinpeter
I needed this too, so I pushed this : https://github.com/JedWatson/react-select/pull/3229
Actually, I need it on a non-async select because sometimes I have > 10 000 options, and for performance reason I want to limit the number of shown options, and let the user type to find more ...
Is this gonna be added any time soon?
Most helpful comment
Hi @Chopinsky @nithinpeter
I needed this too, so I pushed this : https://github.com/JedWatson/react-select/pull/3229
Actually, I need it on a non-async select because sometimes I have > 10 000 options, and for performance reason I want to limit the number of shown options, and let the user type to find more ...