Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter with nested source does not work correctly #5653

Closed
wmwart opened this issue Dec 10, 2020 · 1 comment · Fixed by #5657
Closed

Filter with nested source does not work correctly #5653

wmwart opened this issue Dec 10, 2020 · 1 comment · Fixed by #5657
Labels

Comments

@wmwart
Copy link

wmwart commented Dec 10, 2020

duplicate the issue #5361 as how it got closed but is now actual again

I expected that when adding a filter field to the screen (without entering any value), nothing happens to the current list. Instead, a request is sent to
getList posts {"pagination":{"page":1,"perPage":10},"sort":{"field":"published_at","order":"DESC"},"filter":{"comment":{}}}
and the list becomes empty.

This differs from the behavior of adding a filter for a non-nested field — until a filter value is entered, no pre-request is sent.
The difference in behavior for the user is not obvious.

Often the fields of nested filters are named as if it were a field of the current resource and it is difficult to explain to the user why it works differently.

here's a link Codesandbox https://codesandbox.io/s/aged-https-f8ynv?file=/src/posts/PostList.js with last packages versions

  1. Add a filter comment.title to the Posts list view.
  2. Get unwanted filtering

no, you indicated that you fixed that in 3.9.6 https://github.com/marmelab/react-admin/releases/tag/v3.9.6

I was confused that when I updated the application a couple of weeks ago to 3.9.6 everything worked for me. I was delighted and removed some of the crutches in my backend. Everything worked in the release build. However, when yesterday they began to reassemble the release, the filters again stopped working correctly...
They searched for a long time and determined that if you slip a yarn.lock two weeks ago, then everything works.
Hence the conclusion - something has changed in your dependencies.

  • React-admin version: 3.10.4
  • Last version that did not exhibit the issue (if applicable): 3.9.6
@fzaninotto
Copy link
Member

Reproduced and confirmed, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants