Closed Brunni closed 2 years ago
@Brunni Can you clarify where you add the workaround? I'd be interested in a similar solution for a different use case.
I use string enums, and I need the $eq operator, but it seems for string this library only uses $cont. It would be great to have an actual way to set this up, I may try to submit a PR later, but I'd be happy with a hack for now.
Hi! We are now fine with a different solution and can close this ticket now.
We use the filter type directly in the source tag of the filter input: e.g.
const filters = [
<TextInput source="id||$contL" alwaysOn />,
<TextInput source="name||$contL" alwaysOn />,
];
Just came across the same issue (need to use a case insensitive filter) and the above suggestion (source="name||$contL"
) doesn’t appear to work in React-Admin 4 (4.3.3); when I insert pipes in the source props, the input field stop accepting keystrokes.
I tried with <TextInput>
and <SearchInput>
.
I’ll try to work on a PR, but if you know another workaround, I’m listening. :)
According to nestjsx/crud it supports filter arguments for case-insensitive comparisons for strings:
https://github.com/nestjsx/crud/blob/bbea082a3f0fc7c1be42a79164f41b8449ad2251/packages/crud-request/src/types/request-query.types.ts
CondOperator.CONTAINS_LOW
is the filter typeIt would be very helpful for searching/filtering on text columns.
Workaround code: