tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
675 stars 149 forks source link

Add simple default filter options function #203

Open joeyparis opened 3 years ago

joeyparis commented 3 years ago

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[bot] commented 3 years ago

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