Saulis / iron-data-table

iron-data-table is a Web Component for displaying data as a table or grid. Built on top of iron-list using Polymer.
Apache License 2.0
147 stars 66 forks source link

array-datasource: Unable to filter by boolean attribute #159

Closed lluisgener closed 7 years ago

lluisgener commented 7 years ago

When you bind a column to a boolean attribute, when the filter-value takes the value false, filtering is not working correctly due to null checks with ! operator.

array-datasource.js Line 12

} else if (!value || value.toString().toLowerCase().indexOf(filter[i].filter.toString().toLowerCase()) === -1) { return false; }

It works applying this fix:

} else if (value == null || value.toString().toLowerCase().indexOf(filter[i].filter.toString().toLowerCase()) === -1) { return false; }

Saulis commented 7 years ago

Thanks! Should be fixed in the next version.