You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typical List with Datagrid work as described in documentation with partial pagination even if there are small amount of items in list (i.e. 1,2,3)
What happened instead:
After upgrade to 5.2.1 listview displays empty widget when amount of items in list is less or equal to current pageSize.
In that case getList result total field is null due to partial pagination, also hasPreviousPage and hasNextPage are both false, leading following code to show empty widget even when data is not empty.
Temporary workaround is to artificially set total: in dataprovider when hasPrevious === false && hasNext === false
Related code:
Code in react-admin/packages/ra-ui-materialui/src/list/ListView.tsx
const shouldRenderEmptyPage =
// the list is not loading data for the first time
!isPending &&
// the API returned no data (using either normal or partial pagination)
(total === 0 ||
(total == null &&
hasPreviousPage === false &&
hasNextPage === false)) &&
// the user didn't set any filters
!Object.keys(filterValues).length &&
// there is an empty page component
empty !== false;
Environment
React-admin version: 5.2.1
The text was updated successfully, but these errors were encountered:
What you were expecting:
Typical List with Datagrid work as described in documentation with partial pagination even if there are small amount of items in list (i.e. 1,2,3)
What happened instead:
After upgrade to 5.2.1 listview displays empty widget when amount of items in list is less or equal to current pageSize.
In that case getList result total field is null due to partial pagination, also hasPreviousPage and hasNextPage are both false, leading following code to show empty widget even when data is not empty.
Temporary workaround is to artificially set total: in dataprovider when hasPrevious === false && hasNext === false
Related code:
Code in react-admin/packages/ra-ui-materialui/src/list/ListView.tsx
Environment
The text was updated successfully, but these errors were encountered: