kendo-react icon indicating copy to clipboard operation
kendo-react copied to clipboard

Grid filter returns the value as undefined after changing the operator.

Open simonssspirit opened this issue 3 years ago • 1 comments

Grid filter returns the value as undefined after changing the operator. This happens since 4.8.0. Before that, we were returning null in those cases. The issue is that the value undefined sets the older value to the filter component.

Reproducing steps:

  1. Start with a date column with an empty filter

  2. Set any filter value in the column.

  3. Press "Clear".

  4. Change filtering operation to any other operation (for example "not equal", that's (3) in the console output below)

Notice that after resetting the filter and then setting a new operation the older filter value is populated in the column.

As a workaround we can loop over the filters and set the value from undefined to null:

https://stackblitz.com/edit/react-izhcf2-jqmtxq?file=app/main.tsx

This has to be updated if there are cases line is not null, is null, etc as they are more specific.

simonssspirit avatar Sep 06 '21 09:09 simonssspirit

I have similar issue where if I change column from colA (numeric) to colB (text) then the value stays null instead of "" which is default for text filter.

icelic avatar Jul 19 '22 22:07 icelic

Updated example with the latest version: https://stackblitz.com/edit/react-izhcf2-3idzpu?file=app%2Fmain.tsx

kdikov82 avatar Feb 20 '23 07:02 kdikov82