Skip to content

sibling-count#28

Open
CodingRule wants to merge 1 commit intonasa:mainfrom
CodingRule:main
Open

sibling-count#28
CodingRule wants to merge 1 commit intonasa:mainfrom
CodingRule:main

Conversation

@CodingRule
Copy link
Copy Markdown

Summary

This PR adds a new sibling-count option to terra-pagination so consumers can control how many page buttons show on each side of the current page.

What changed

  • Added sibling-count property/attribute to terra-pagination (default is 1)
  • Refactored visible page generation into a generalized algorithm
  • Added input normalization and clamping for current, total, and sibling-count
  • Removed duplicate visible page recomputation on click
  • Replaced per-page inline click closures with a shared click handler using data-page
  • Added a new test suite for pagination behavior and interactions
  • Updated docs/pages/components/pagination.md with:
    • a new usage example for sibling-count
    • API notes for the new option

Why

Pagination worked well for the default case, but there was no way to control page window size for larger datasets. This adds that flexibility while keeping existing defaults intact.

Backward compatibility

No breaking changes.
If sibling-count is not set, behavior stays the same as before.

Testing

  • npx web-test-runner --group pagination
  • npm run build

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