Skip to content

[Paginator] Announce the page status to screen readers - #5475

Merged
Denis Voituron (dvoituron) merged 7 commits into
microsoft:devfrom
oONoobMasterOo:fix/paginator-status-live-region
Oct 21, 2026
Merged

Denis Voituron (dvoituron) merged 7 commits into
microsoft:devfrom
oONoobMasterOo:fix/paginator-status-live-region

Conversation

@oONoobMasterOo

@oONoobMasterOo NoobMaster (oONoobMasterOo) commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

📖 Description

When the user navigates with the first / previous / next / last buttons, the new page ("Page 2 of 2") is now announced to screen readers.

Changes

  • FluentPaginator renders a visually hidden polite live region (role="status" aria-live="polite"), like the DataGrid sort announcement, with the page status ("Page 2 of 2").
  • Only the paginator whose buttons changed the page announces it. Several paginators often share the same PaginationState (e.g. above and below the grid, as in DataGrid/GettingStarted): making each pagination text a live region would announce the new page once per paginator. PaginationState keeps the paginator that changed the page (internal), and the other paginators keep an empty live region.
  • At the first and last pages, the first / previous or next / last buttons are now disabled but focusable (DisabledFocusable) instead of disabled: when "Next" reached the last page, the focused button was disabled, the focus moved to the document and screen readers announced the page title before the page status. Disabled on the paginator still disables all the buttons.
  • The visible pagination text (and a custom PaginationTextTemplate) is unchanged.

🎫 Issues

👩‍💻 Reviewer Notes

The live region is visually hidden with the same CSS as the DataGrid sort status. The first / previous and next / last buttons are now DisabledFocusable at the first and last pages, so the focus isn't lost.

📑 Test Plan

Unit tests

Added:

  • FluentPaginator_PageStatus_IsAnnouncedByThePaginatorUsed
  • FluentPaginator_PageStatus_MovesToTheLastPaginatorUsed
  • FluentPaginator_NextButton_OnLastPage_DoesNotChangePage

Updated FluentPaginator_FirstPageButtons_DisabledWhenOnFirstPage and FluentPaginator_LastPageButtons_DisabledWhenOnLastPage for disabled-focusable.

The FluentPaginator snapshots are updated with the (empty) live region and disabled-focusable.

  • Full tests/Core suite on this branch: 4906 tests, 0 failed (at 7de39e0ea).

Manual test

Demo, DataGrid/GettingStarted (two paginators sharing the same state): "Next" on the bottom paginator fills only its live region ("Page 2 of 3"), then "Next" on the top paginator fills only the top one ("Page 3 of 3") and clears the bottom one.

Other checks

  • Before / after video: see the comment with the recordings below.
  • Recorded with Narrator (see the video). Not tested with NVDA or JAWS.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

AI contribution declaration

AI assistance is allowed; fully AI-generated or autonomous pull requests without meaningful human review are not accepted. See the AI contribution policy.

  • I have read and followed the AI contribution policy.
  • I have personally reviewed and understood all changes, tested them, and take responsibility for this contribution.

Component-specific

  • I have added a new component
  • I have added Unit Tests for my new component
  • I have modified an existing component
  • I have validated the Unit Tests for an existing component

⏭ Next Steps

None.

The "Page X of Y" text is now a polite status live region, so screen
readers announce the new page when the user navigates between pages.

Fixes microsoft#5473

Copilot AI left a comment

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.

🟢 Approval recommended

The focused markup change has matching regression coverage and no blocking issues; tests were not run.

No open issues 🎉

What changed in this PR

Addresses #5473 by making the paginator’s page status a polite live region for screen-reader announcements.

Changes:

  • Adds live-region attributes for default and custom pagination text.
  • Adds a page-navigation regression test and updates four snapshots.
File Description
tests/​Core/​Components/​Paginator/​FluentPaginatorTests.razor Tests live-region attributes and updated page text.
tests/​Core/​Components/​Paginator/​FluentPaginatorTests.FluentPaginator_SetItemsPerPage.verified.razor.html Updates items-per-page snapshot.
tests/​Core/​Components/​Paginator/​FluentPaginatorTests.FluentPaginator_Renders_WithDefaultState.verified.razor.html Updates default-state snapshot.
tests/​Core/​Components/​Paginator/​FluentPaginatorTests.FluentPaginator_Renders_CustomSummaryTemplate.verified.razor.html Updates custom-summary snapshot.
tests/​Core/​Components/​Paginator/​FluentPaginatorTests.FluentPaginator_Renders_CustomPaginationTextTemplate.verified.razor.html Updates custom-pagination snapshot.
src/​Core/​Components/​Pagination/​FluentPaginator.razor Adds role="status" and aria-live="polite".

Review effort: Balanced

@dvoituron Denis Voituron (dvoituron) added the Generated by AI Content generated or significantly assisted by AI. label Oct 19, 2026
@dvoituron

Copy link
Copy Markdown
Collaborator

Could you please provide a short video showing the issue before the code change, and then the expected behavior after the fix? This will make it easier to clearly see and validate the improvement.
(You can use “Peek - Screen Recorder,” a free tool, to do this)

When several paginators share the same PaginationState (e.g. above and
below a grid), every pagination text was a live region, so the new page
was announced once per paginator. The status is now announced in a
hidden live region of the paginator whose buttons changed the page.
…or last page

The first / previous / next / last buttons were disabled when the page
couldn't change, so the focused button lost the focus when reaching the
first or last page, and screen readers announced the page title. They're
now disabled but focusable at the first and last pages.
@oONoobMasterOo

NoobMaster (oONoobMasterOo) commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Here is the requested video, recorded with Narrator (sound on) on DataGrid/GettingStarted, using the "Go to next page" button of the bottom paginator.

Before (dev): the page changes, but the new page isn't announced.

5475-before.mp4

After (this PR): "Page 2 of 3", then "Page 3 of 3" is announced once. At the last page, the focus stays on the button, so the page title is no longer announced.

5475-after.mp4

Recording this showed two issues in the first version of the PR, both fixed now: the page was announced twice on pages with two paginators sharing the same state, and the focus was lost when the button became disabled at the last page. The PR description is updated.

@dvoituron

Copy link
Copy Markdown
Collaborator

We've added a new requirement regarding PRs

@oONoobMasterOo

Copy link
Copy Markdown
Contributor Author

We've added a new requirement regarding PRs

Checked

@dvoituron Denis Voituron (dvoituron) removed the Generated by AI Content generated or significantly assisted by AI. label Oct 21, 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.

{Linked:Bug18768} - Screen reader does not announce updated pagination status when navigating between pages.

3 participants