List reacts on filter, pagination and sorting parameters if they are set in dialog modal
What you were expecting:
Once a <Dialog /> modal contains a <List /> view of Resource A and has filtering + pagination active, the <List /> view of Resource B that is still visible behind the modal ignores the URL query params set by the List view of Resource B - and therefore does not re-render.
What happened instead:
Once a <Dialog /> modal contains a <List /> view of Resource A and has filtering + pagination active, the <List /> view of Resource B that is still visible behind the modal notices the query params set by the List view of Resource B - and therefore re-renders its resultset.
Because of the query params page, order, filter etc. the list view in the background gets re-rendered although it shows a list of records that belongs to another resource.
https://myadmin.dev/#/posts?displayedFilters=%7B%22commentable%22%3Atrue%7D&filter=%7B%22commentable%22%3Atrue%2C%22q%22%3A%22lorem%20%22%7D&order=DESC&page=1&perPage=10&sort=published_at
Steps to reproduce:
- Create a
<List />view of a Resource A - Create an action that opens a
<Dialog />modal (without location change!!) <Dialog />modal contains a<List />view with pagination + filters of Resource B- Changing the pagination or the filters in Resource B causes the List view in the background to re-render.
Environment
- React-admin version: 3.5.5
- Last version that did not exhibit the issue (if applicable): -
- React version: 16.13.1
- Browser: Chrome, Firefox, Safari
- Stack trace (in case of a JS error): -
There can be only one <List> per route, as <List> uses routing. You have to write your own component to display a custom list inside a Dialog.