komarovalexander / ka-table

Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more
http://ka-table.com
MIT License
788 stars 58 forks source link

Filter operators isEmpty and isNotEmpty are Non-functional #384

Closed krukrue closed 8 months ago

krukrue commented 8 months ago

I prepared demo to show it: https://stackblitz.com/edit/table-filter-row-custom-editor-ts-vpjndu?file=Demo.tsx

Tip for improving https://github.com/komarovalexander/ka-table/blob/master/src/lib/Utils/CommonUtils.ts - in isEmpty function would be good to compare not only null or empty array, but empty string also.

Thank you.

komarovalexander commented 8 months ago

Hi @krukrue thanks for example, I will investigate it. btw isEmpty works correctly as value.length === 0 is an empty string check also, maybe not so obvious - but it is covered by tests and do not see the reason to write (value.length === 0 || value =='') as both comparisons do the same

komarovalexander commented 8 months ago

fixed in v8.8.1

demo: https://stackblitz.com/edit/table-filter-row-custom-editor-ts-4prfhw?file=Demo.tsx