Skip to content

Commit

Permalink
Merge pull request #4039 from marmelab/fix-referenceinput-default-filter
Browse files Browse the repository at this point in the history
Fix ReferenceInput should not set filter in getList when q is empty
  • Loading branch information
djhi authored Nov 25, 2019
2 parents 43d60c7 + 260b6f3 commit 5176b3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/ReferenceArrayInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ReferenceArrayInput.propTypes = {
ReferenceArrayInput.defaultProps = {
allowEmpty: false,
filter: {},
filterToQuery: searchText => ({ q: searchText }),
filterToQuery: searchText => (searchText ? { q: searchText } : {}),
perPage: 25,
sort: { field: 'id', order: 'DESC' },
};
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/ReferenceInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ ReferenceInput.propTypes = {
ReferenceInput.defaultProps = {
allowEmpty: false,
filter: {},
filterToQuery: searchText => ({ q: searchText }),
filterToQuery: searchText => (searchText ? { q: searchText } : {}),
perPage: 25,
sort: { field: 'id', order: 'DESC' },
};
Expand Down

0 comments on commit 5176b3f

Please sign in to comment.