Skip to content

Fix: correct edge page filtering#18

Open
martonpaulo wants to merge 1 commit intothijssmudde:mainfrom
martonpaulo:main
Open

Fix: correct edge page filtering#18
martonpaulo wants to merge 1 commit intothijssmudde:mainfrom
martonpaulo:main

Conversation

@martonpaulo
Copy link
Copy Markdown

Issue:
Edge pages are not filtered correctly, leading to non-sequential pagination when slicing out middle pages.

pagination-bug.mp4

Cause:
The previous logic removed items from the middle of the array without considering sequential order.

Fix:

  • Filter left edge pages to only include pages before the first middle page.
  • Filter right edge pages to only include pages after the last middle page.

Testing:

  • Verified pagination renders sequentially with parameters like:
totalPages={10}
edgePageCount={6}
middlePagesSiblingCount={1}

Please review the changes.

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 18, 2025

Deploy Preview for react-headless-pagination failed.

Name Link
🔨 Latest commit d22bba0
🔍 Latest deploy log https://app.netlify.com/sites/react-headless-pagination/deploys/67b517677584ad0008e93daa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant