reactdatagrid icon indicating copy to clipboard operation
reactdatagrid copied to clipboard

A single digit typed into a date filter is interpreted as a complete date, with further typing continuing to be appended

Open redler opened this issue 4 years ago • 0 comments

Edition: Enterprise Version: 4.1.24

Repro case can be observed directly on the ReactDataGrid.io demo page:

  1. Visit https://reactdatagrid.io/demo
  2. Type the digit 1 into the date filter for the Date of Birth column
  3. Observe that the filter immediately redraws to show 01/01/2021
  4. Further typing of digits appends them to the above. For example, if you type 16 into the field, it immediately redraws to contain 01/01/20216

Suggested solution:

Values typed into a date filter field should be held in a different local component state variable that does not activate the filtering until some event signifies the completion of the entry of what is likely to be the actual user-intended date. That intent could be signaled by either the user hitting Enter, the user completely filling the digit space that matches the filter's configured dateFormat, etc. If there is no such "intent signal" somehow baked into the interpretation of a user-entered date, then a single digit, as above, is turned into a date (since a single digit can technically represent a valid date, albeit not the one the user intends).

redler avatar Sep 02 '21 19:09 redler