close
Skip to content

Dataviews Pagination: Deleting the last item on a page should navigate to the previous page (if exists) instead of showing No results #68707

@yogeshbhutkar

Description

@yogeshbhutkar

Description

When there is only one data item on a page in the DataViewsPagination component, and that item is deleted, the pagination should automatically navigate to the previous page.

Currently, the behavior results in displaying a 'No results' message, which is not the expected behavior. This issue needs to be addressed to improve the user experience by ensuring that the pagination correctly navigates to the previous page (if exists) when the last item on the current page is deleted.

This can be reproduced in both All Patterns and All Templates pages.

Step-by-step reproduction instructions

  1. Navigate to site editor.
  2. Navigate to Patterns.
  3. Confirm all the patterns are displayed in a pagination.
  4. Make sure, on a particular page, that there's just one data item being displayed.
  5. Delete that particular data item.
  6. Confirm, that a no results message is displayed and the page didn't navigate back even though previous pages are available.

Screenshots, screen recording, code snippet

issue.mov

Environment info

  • WordPress Version: 6.8-alpha-59361
  • Gutenberg Version: Trunk (74986ed)
  • OS: macOS Sequoia

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyond[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions