Skip to content

fix(storefront/a11y): pagination uses non-semantic divs, missing aria-current and aria-disabled #1978

Description

@filiphsps

What to build

apps/storefront/src/components/actionable/pagination.tsx renders the current page and the disabled prev/next as plain <div> elements. They are not keyboard-reachable, lack aria-current="page", and lack aria-disabled="true". Screen-reader users cannot tell which page they're on, and disabled controls aren't announced as disabled.

Fix:

  • Current-page indicator becomes an <a aria-current="page"> (or <span aria-current="page"> if non-interactive — pick one based on whether clicking is a no-op).
  • Disabled prev/next become <a aria-disabled="true" tabindex="-1"> with an actual href attribute removed, or a <button disabled> — consistent with how the active prev/next are rendered.
  • Visible focus ring on every interactive cell.
  • Touch target ≥ 44 × 44 px (overlaps with Update dependency typescript to v4.8.3 - autoclosed #10).

Acceptance criteria

  • No <div> elements in pagination markup that should be interactive
  • aria-current="page" on the active page
  • aria-disabled="true" on the disabled prev/next
  • Pagination fully keyboard-navigable (Tab moves through pages, Enter activates)
  • Existing pagination tests updated; new assertions for ARIA attributes
  • Axe audit on a paginated collection page passes

Blocked by

None — can start immediately.

References

  • apps/storefront/src/components/actionable/pagination.tsx:62-65,110-113,132-135

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingComponentsready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions