Conversation
The default empty list page, which is an invite to create new elements, appears even when some elements already exist. Here is a repro that can be tested in the simple example: 1. Go to the post list (in a large screen to show the datagrid version) 2. Select all rows using the top left checkbox 3. Hit the bulk delete button The empty page shows up, even though there are remaining posts (in the following page). This bug was introduced by #8945, which fixed a bug with partial pagination. The condition for displaying the empty page is wrong: https://github.com/marmelab/react-admin/blob/e6129b2d1aded97f55bf40bf1d5602cc42a03113/packages/ra-ui-materialui/src/list/ListView.tsx#L60-L64
djhi
approved these changes
Sep 10, 2024
d166db5 to
b6eb9e1
Compare
djhi
approved these changes
Sep 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The default empty list page, which is an invite to create new elements, appears even when some elements already exist.
Here is a repro that can be tested in the simple example:
The empty page shows up, even though there are remaining posts (in the following page).
Cause
This bug was introduced by #8945, which fixed a bug with partial pagination.
The condition for displaying the empty page is wrong, as it only counts the number of results in the current page (
data.length) instead of the total number of results:react-admin/packages/ra-ui-materialui/src/list/ListView.tsx
Lines 60 to 64 in e6129b2