Aidurber / react-picky

Yet another React multiselect. With checkbox support instead of tags.
MIT License
79 stars 35 forks source link

filter search box should trim spaces before and after content #200

Closed Riteshgiri closed 4 years ago

Riteshgiri commented 4 years ago

Here's what went wrong:

In the search filter box, any white space before and after the content should be removed

Example : If dropdown has a list of countries, and we search with " United States"/ "United States ", United States wont show up as there is a whitespace before and after the search word.

thanks. Any help on this would be valued.

Aidurber commented 4 years ago

Hi @Riteshgiri It's a fair point but I don't want to force everyone to conform to the same. The most flexible way will be to add something like filterTermProcessor: (term:string) => string. That way the developer can do whatever they need to the term. The default will just be: (term) => term. Doing this also means that we don't have to release a major version since there's no possible breaking change for existing users.

I'll try and look into it tomorrow evening.