Skip to content

fix(ui): add accessible label to pagination arrows#17380

Open
vansh17June wants to merge 3 commits into
payloadcms:mainfrom
vansh17June:fix/pagination-accessible-name
Open

fix(ui): add accessible label to pagination arrows#17380
vansh17June wants to merge 3 commits into
payloadcms:mainfrom
vansh17June:fix/pagination-accessible-name

Conversation

@vansh17June

@vansh17June vansh17June commented Jul 17, 2026

Copy link
Copy Markdown

What?

Adds accessible names to the admin pagination arrow buttons and marks the decorative chevron icon as hidden from assistive technologies.

Why?

The pagination controls are icon-only buttons and currently have no accessible name, causing screen readers to announce them only as "button". This triggers the axe-core button-name accessibility rule and makes the controls difficult to understand for screen-reader users.

How?

  • Added an aria-label to ClickableArrow.

  • Derived the label from the direction prop:

    • leftPrevious page
    • rightNext page

Fixes #17377

disabled={isDisabled}
onClick={!isDisabled ? updatePage : undefined}
type="button"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Empty line, remove.


>
<ChevronIcon />
<ChevronIcon />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Extra space here, remove.

const { direction = 'right', isDisabled = false, updatePage } = props

const ariaLabel =
direction === 'left' ? 'Previous page' : 'Next page'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You will need to use change this a bit to use translations.

// ... imports
+ import { useTranslation } from '../../../providers/Translation/index.js'

// ... function code
+ const { t } = useTranslation()

- const ariaLabel = direction === 'left' ? 'Previous page' : 'Next page'
+ const ariaLabel = direction === 'left' ? t('general:previous') : t('general:next')

@JarrodMFlesch JarrodMFlesch self-assigned this Jul 17, 2026
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.

Admin pagination: previous/next arrow buttons have no accessible name

2 participants