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

Add simple default filter options function #203

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joeyparis
Copy link

Currently, if you set the search prop to true but do not provide a filterOptions function then the entire options list is always returned. I added a simple default filter function that checks if the search value is included (case insensitive) anywhere in the name value of each option.

Alternatively, we could log an error/warning if search is true but filterOptions is null.

@vercel
Copy link

vercel bot commented Jul 12, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tbleckert/react-select-search/E624VfFZQWGrJQDNXqZP44oDLzkt
✅ Preview: https://react-select-search-git-fork-joeyparis-default-cb99e3-tbleckert.vercel.app

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.

2 participants