Skip to content

Feat/add datalist pagination styling pfr 1133#3890

Merged
jeroenreijs merged 6 commits intoedgefrom
feat/add-datalist-pagination-styling-PFR-1133
Mar 10, 2026
Merged

Feat/add datalist pagination styling pfr 1133#3890
jeroenreijs merged 6 commits intoedgefrom
feat/add-datalist-pagination-styling-PFR-1133

Conversation

@MarcelKorporaal
Copy link
Collaborator

Summary

This PR improves the DataList pagination by making page navigation boundaries explicit and adding styling support for pagination alignment and color. The update prevents navigating beyond valid pages, keeps the pagination controls semantically correct, and allows pagination presentation to be configured through component options.

Changes

Pagination behavior

  • Introduced a single, explicit totalPages calculation (Math.ceil(totalCount / rowsPerPage)).

  • Added derived flags for navigation boundaries:

    • isPrevDisabled (disabled on page 1)
    • isNextDisabled (disabled on the last page)
  • Updated pagination controls to use the native disabled attribute instead of conditionally rendering buttons vs. non-clickable icons.

  • Kept the existing safety check that clamps currentPage when the result set shrinks (e.g. after filtering/search changes).

Pagination styling support

  • Added support for configuring pagination styling via options:

    • Pagination alignment (left/center/right)
    • Pagination color
  • Applied these settings at the footer level so the pagination block aligns and inherits the configured color consistently.

Why

Previously, pagination boundaries were enforced through conditional rendering and a “next” comparison based on totalCount / rowsPerPage, which can result in fractional comparisons and less readable logic. Disabled states were also represented by swapping elements rather than using button semantics.

This PR:

  • Uses integer page math (totalPages) for clearer, predictable boundaries.
  • Improves accessibility and keyboard behavior by relying on <button disabled>.
  • Adds configurable alignment and color so DataList pagination can match page design requirements without custom overrides.

Testing

  • Verified prev is disabled on page 1 and next is disabled on the last page.
  • Verified the current page is clamped when totalCount decreases (e.g. after filter/search changes).
  • Verified pagination alignment and color options apply correctly and do not affect data rendering in inline/grid modes.

@MarcelKorporaal
Copy link
Collaborator Author

@jeroenreijs jeroenreijs changed the base branch from edge to acceptance February 17, 2026 08:18
@jeroenreijs jeroenreijs changed the base branch from acceptance to edge February 17, 2026 08:19
JorisPannekeet
JorisPannekeet previously approved these changes Feb 17, 2026
Copy link
Collaborator

@jeroenreijs jeroenreijs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at my comments.

@marcelkorporaal-a11y
Copy link

Requested changes have been applied

@jeroenreijs jeroenreijs merged commit 53e779d into edge Mar 10, 2026
2 checks passed
@bettyblocks-release-bot
Copy link
Collaborator

🎉 This PR is included in version 3.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants