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

alwaysOn Filters impossible to reset properly

Open remi13131 opened this issue 9 years ago • 2 comments

Two different bugs linked in some way about alwaysOn Filters :

  • When selecting a date in an alwaysOn DateInput, it is impossible to remove this filter afterward (no button of any kind, not possible to select text and delete) only by refreshing the List View (and this behavior is actually a bug https://github.com/marmelab/admin-on-rest/issues/416 so there is virtually no way to reset an alwaysOn DateInput filter) For non-alwaysOn filters this can be achieved by removing then selecting again the filter in the list.

  • When typing an incorrect value in an alwaysOn NumberInput then clicking somewhere else or when focusing the field, then clicking somewhere else, this will convert to null value in the GET request made to the API, hence resulting in no-results: issueadminonrestfilters0 Not putting "Null" but removing entirely the key in the URL/request would correct this bug.

I think it would be great if the small button that is displayed for non-alwaysOn Filters was still here and acting as a reset-button for alwaysOn Filters. A general button for resetting the whole filter form would be good as well.

remi13131 avatar Mar 14 '17 15:03 remi13131

For the first bug, it's a limitation of material-ui's <DatePicker> component (see https://github.com/callemall/material-ui/issues/3933) that we won't overcome here. Bottomline: don't use <DateInput> as filter.

fzaninotto avatar May 03 '17 14:05 fzaninotto

Bottomline: don't use as an alwaysOn filter

djhi avatar May 03 '17 15:05 djhi