Skip to content

Give QuickGrid paginator navigation an accessible name - #70002

Open
snemeckayova wants to merge 2 commits into
mainfrom
snemeckayova/paginator-navigation-accessible-name
Open

snemeckayova wants to merge 2 commits into
mainfrom
snemeckayova/paginator-navigation-accessible-name

Conversation

@snemeckayova

Copy link
Copy Markdown
Contributor

Name Paginator navigation landmarks and support application-supplied names.

Description

Paginator currently renders a navigation landmark without an accessible name,
making it difficult to distinguish from other navigation regions on a page.

This change:

  • Adds the default accessible name "Pagination" to the shared navigation element.
  • Adds an AdditionalAttributes parameter so applications can supply a custom
    aria-label or aria-labelledby, including localized names or names that
    distinguish paginators for different grids.
  • Documents the new parameter and records it in PublicAPI.Unshipped.txt.
  • Adds browser regression coverage for default names, custom summaries,
    aria-label overrides, and aria-labelledby in both link and compatibility
    button modes, plus default naming in static server rendering.

Pagination behavior, control labels, styling, and layout remain unchanged.

Fixes dotnet/aspnetcore-scenario-tests#152

@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Oct 23, 2026
@snemeckayova snemeckayova self-assigned this Oct 23, 2026
@snemeckayova
snemeckayova marked this pull request as ready for review October 26, 2026 08:04
@snemeckayova
snemeckayova requested a review from a team as a code owner October 26, 2026 08:04
@snemeckayova
snemeckayova requested review from dariatiurina and ilonatommy and a balanced review from Copilot October 26, 2026 08:04

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.

🔵 Needs a closer look

No blocking defects were identified, but browser validation remains unverified and the available review evidence does not establish readiness for automated approval.

No open issues 🎉

What changed in this PR

This PR gives QuickGrid paginator navigation landmarks a default accessible name and lets applications provide localized or grid-specific names.

Changes:

  • Adds the default navigation label “Pagination” and an AdditionalAttributes parameter for application overrides.
  • Documents and records the new public parameter.
  • Adds accessible-name assertions for link navigation, compatibility button mode, and static server rendering.
File Description
src/​Components/​test/​testassets/​Components.TestServer/​RazorComponents/​Pages/​QuickGrid/​QuickGridInteractive.razor Adds custom-summary and application-supplied naming scenarios.
src/​Components/​test/​E2ETest/​Tests/​QuickGridNoInteractivityTest.cs Checks the default accessible name in static rendering.
src/​Components/​test/​E2ETest/​Tests/​QuickGridInteractiveTest.cs Checks default and overridden names in link mode.
src/​Components/​test/​E2ETest/​Tests/​QuickGridInteractiveCompatTest.cs Checks the same naming scenarios in compatibility mode.
src/​Components/​QuickGrid/​Microsoft.AspNetCore.Components.QuickGrid/​src/​PublicAPI.Unshipped.txt Records the new parameter’s public accessors.
src/​Components/​QuickGrid/​Microsoft.AspNetCore.Components.QuickGrid/​src/​Pagination/​Paginator.razor.cs Declares and documents AdditionalAttributes.
src/​Components/​QuickGrid/​Microsoft.AspNetCore.Components.QuickGrid/​src/​Pagination/​Paginator.razor Applies the default label and supplied attributes to the navigation element.

Review effort: Balanced

Comment on lines +46 to 48
<div class="labelled-paginator">
<Paginator State="@pagination2" aria-labelledby="people-pages" />
</div>

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.

Do we need to have this third paginator with the aria-labelledby? If yes, then can we have it similarly to what Virtualize does with the anchor mode tests with buttons?

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.

I would go even further: why do we need the 2nd paginator? It is a bit more convenient for the user but we're shipping basic components. I think it's fine to have only one paginator. E.g. FluentUI has only one https://github.com/microsoft/fluentui-blazor/blob/3549cf4ed44629a6169cd46ae75b3011b8e21326/examples/Demo/FluentUI.Demo.Client/Documentation/Components/DataGrid/Examples/DataGridTypical.razor#L55

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.

@ilonatommy this test particularly tests that two paginators work with one quickgrid with the url-based navigation, while it wasn't possible previously

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.

I see now that we used to ship 2 even before accessibility fix. Then 2 is fine.

Comment on lines +113 to +123
[Theory]
[InlineData(".first-paginator", "Pagination")]
[InlineData(".top-paginator", "Pagination")]
[InlineData(".bottom-paginator", "People pages")]
[InlineData(".labelled-paginator", "More people pages")]
public void PaginatorNavigationHasAccessibleName(string selector, string expectedName)
{
Navigate($"{ServerPathBase}/quickgrid-interactive");

Browser.Equal(expectedName, () => Assert.IsAssignableFrom<WebElement>(Browser.FindElement(By.CssSelector($"{selector} .paginator nav"))).ComputedAccessibleLabel);
}

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.

nit: Can have one long E2E test that will test all paginators instead of having 4?

@dotnet dotnet deleted a comment from github-actions Bot Oct 26, 2026
@dotnet dotnet deleted a comment from github-actions Bot Oct 26, 2026

This branch has not been deployed

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

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants