Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New filterMaxResults option to easily limit the default filtering #2611

Closed
wants to merge 1 commit into from

Conversation

peterbartos
Copy link

@peterbartos peterbartos commented May 15, 2018

New filterMaxResults option to easily limit the default filtering function results count.
It shows the first filterMaxResults items. FIX #126

…ction

results count. It shows the first `filterMaxResults` items. FIX JedWatson#126
@gwyneplaine
Copy link
Collaborator

@peterbartos thanks for this PR, just a few queries:

  1. What is your reason for reducing results after filtration in this way? If it's to avoid rendering a long list of results for performance reasons, I would imagine react-select virtualized would provide an adequate resolution here.
  2. I'm a little worried that we're arbitrarily reducing the number of results from filterOptions, without a good way of viewing all of the results. This seems like functionality that would be best paired with pagination, but seems incomplete on its own.
  3. Aside from the two concerns above, the slice on filterMaxResults would probably be better placed on the filterOptions method within the Select, as opposed to the default prop value, so that filterMaxResults logic is always applied on filtration, irrespective of the value of this.props.filterOptions.

Would love your thoughts, thanks again

@peterbartos
Copy link
Author

Hi @gwyneplaine thank you for your attention

  1. The reason I find this useful is a simple solution for Limiting number of options displayed in dropdown #126. In our case we have few hundreds of options and there's a lag on filtering in the cases it displays many results. You are right, the virtualized package seems like a solution too, but this update would help without having to include extra packages.

  2. I see your worries of lacking pagination. I think for the use cases reported in Limiting number of options displayed in dropdown #126 the pagination is not needed – as the benefit is to show only the closest matches. I'm concerned that the pagination would be hard for this update.

  3. You are right. If you think this feature is still possible to include without the pagination, I would quickly move the slice into Select as you suggest.

@whiterook6
Copy link

Any update on this? Would love to see maxFilterResults included in react-select.

@flexdinesh
Copy link
Collaborator

flexdinesh commented Mar 22, 2020

Hey @peterbartos v1 of react-select is no longer maintained.

Thanks for taking your time out to create this PR but since this is relevant to v1, we recommend maintaining your own v1 fork if you want to address v1 issues. We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest versions.

We highly recommend upgrading from v1 to v2.

I'm closing this issue/PR now. Feel free add your thoughts in #3981 and reference this issue/PR if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limiting number of options displayed in dropdown
4 participants