Closed lluisgener closed 7 years ago
Hmm.. If I understand you correctly, that should not be happening.
If the item property has a value, let's say "foobar"
and the filter is empty (""
), "foobar".indexOf('')
returns 0
which will evaluate to true
in return the item.
I have even a test case for it here: https://github.com/Saulis/iron-data-table/blob/master/test/filtering.html#L84
I'm guessing you mean a situation where the item does NOT have a value and the filter is ""
?
That's a use case I haven't considered earlier, can you try if the branch ignore-empty-filter
works better for you?
You're right, the problem is when the value is undefined or null, and the filter is "".
The branch seems to work fine for me. Will it make it to trunk?
Thanks.
Sure, I'll make a new release asap
Filtering seems to have gone worse with the fix to #168
If a field has a value, and the filter is empty (string value is ""), it returns false for every row, rendering the whole grid empty.
This code seems to work well for every case I have tested: