enkidevs / react-search-input

:mag: Simple react.js component for a search input, providing a filter function.
302 stars 72 forks source link

Support lists #101

Closed ghost closed 7 years ago

mathieudutour commented 7 years ago

I'm not sure I understand what this PR is fixing: I'm pretty sure it's already working with arrays. Is it for Immutable.List?

I just added some tests. Could you write a case which is failing now and that this PR is fixing?

JesseBuesking commented 7 years ago

Ran into this today. My data has a field like

{
  'field': [
    'option1',
    'option2',
  ]
}

Searching on field won't match against any of those array values. I tried running the logic in this PR and it magically works. Let me know if that's clear enough or if you need more info.

JesseBuesking commented 7 years ago

Thank you for the quick response! I just updated my project and gave it a whirl, and it looks like things are working!

Just a heads up, fuzzy searching seems to only search the array fields now and not others. I don't use fuzzy searching in my project so it's not an issue for me, but I just tried it out and noticed this issue.

Thank you again!