Closed sulcad14 closed 4 years ago
Hi, and thanks for this issue.
I cannot reproduce any problem when adding a similar filter in the simple example:
const tags = [
{ id: 'testTag1', name: 'testTag1' },
{ id: 'testTag2', name: 'testTag2' },
];
const PostFilter = props => (
<Filter {...props}>
<SearchInput source="q" alwaysOn />
<SelectArrayInput source="tags" choices={tags} alwaysOn />
</Filter>
);
Selecting one of more tags properly changes the URL and sends a request to the dataProvider:
getList posts {"pagination":{"page":1,"perPage":10},"sort":{"field":"published_at","order":"DESC"},"filter":{"tags":["testTag1","testTag2"]}}
If if doesn't return anything, it's probably because you've not handled the case where the value of a filter is an array in your dataProvider
.
As it's not a bug in react-admin, I'm closing this issue.
What you were expecting: I was expecting to filter the List component by my tag property, that is an array (index: value).
What happened instead: Basically nothing. The filter returns an empty List.
Steps to reproduce: Check out related code.
Related code:
Environment React-admin version: 3.2.2