Skip to content

Fix: accessible snippets pagination#372

Merged
rami-elementor merged 1 commit intocore-betafrom
a11y-pagination
May 5, 2026
Merged

Fix: accessible snippets pagination#372
rami-elementor merged 1 commit intocore-betafrom
a11y-pagination

Conversation

@rami-elementor
Copy link
Copy Markdown
Contributor

@rami-elementor rami-elementor commented May 1, 2026

image

This pull request refactors the pagination controls in TablePagination.tsx to improve code organization and accessibility. The main changes include extracting navigation link logic into a separate NavigationLinks component and wrapping the pagination controls in a <nav> element with an accessible label.

Component refactoring and accessibility improvements:

  • Extracted the navigation link buttons into a new NavigationLinks component, separating concerns and making the codebase more modular.
  • Wrapped the pagination controls in a <nav> element with an aria-label to improve accessibility for screen readers. The label changes depending on whether the controls are above or below the table.
  • Updated the main PaginationControls component to use the new NavigationLinks component and reorganized its structure for clarity.

@rami-elementor rami-elementor requested a review from a team May 3, 2026 06:24
confirmInputValue={() => setCurrentPage(inputValue)}
/>{'\n'}
}) => {
const navLabel = 'top' === which
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This variable would be cleaner inlined, IMO.


type NavigationLinksProps = Omit<PaginationControlsProps, 'totalItems'>

const NavigationLinks: React.FC<NavigationLinksProps> = ({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the benefit in taking this block out specifically? I don't think the original component was overly complex, and this leads to more mass prop-drilling.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Lint warning:

Arrow function has too many lines (52). Maximum allowed is 50 max-lines-per-function

@rami-elementor rami-elementor merged commit aff345b into core-beta May 5, 2026
8 checks passed
@rami-elementor rami-elementor deleted the a11y-pagination branch May 5, 2026 05:37
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.

2 participants