Two lists for the same resource share the same store for their state
See original GitHub issueWhat you were expecting:
I have 2 lists for the same resource. One list is accessible from the main menu and shows all datasets with a rows per page set to 25. The second list for the same resource is part of a tabform in an edit dialog of another resource and shows related datasets. Here we have rows per page of 10 and different search fields than in the first list.
Both lists should should be completely separated and the state of search fields, order and rows per page in the store should be stored for both instances separately.
What happened instead:
When I search for data in the second list or change the sort order there, an entry is written in the store with the state of search fields, order and pagination. After that I open the first list from the main menu. Here we see now 10 rows per page instead of 25 and data is filtered by criteria that we entered in the second list. Unfortunately we cannot change the filter because we have different search fields.
The state is stored with the key RaStore.resource_name.listParams
and is used for both lists, even they are configured differently.
Environment
- React-admin version: 4.2.5
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (6 by maintainers)
@crates PR https://github.com/marmelab/react-admin/pull/8073 should have you covered. It should be merged pretty soon.
Also note that if you do not want the list to save and read its state from the store, you have to use the disableSyncWithLocation prop.
StackBlitz for @StefanFl’s example: https://stackblitz.com/github/StefanFl/react-admin-8038/tree/master/examples/simple