Repository navigation
[release/11.0] Give QuickGrid paginator navigation an accessible name - #70093
Conversation
Consolidate naming scenarios into one test per navigation mode and reuse the existing paginator for heading-based naming via a test button. Co-authored-by: Copilot App <[email protected]>
|
Hi @github-actions[bot]. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
|
/ba-g The failure is "Detected modification to baseline API files. PublicAPI.Shipped.txt files should only be updated after a major release, and PublicAPI.Unshipped.txt files should not be updated in release branches." Consulted with tactics: "Compliance, low risk - approved for Dec servicing" under the condition of getting a second PR review and updating appropriate documentation / API ref docs (dotnet/AspNetCore.Docs#38069). |
|
Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed. |
|
Waiting for information how to handle public API warnings, to not pollute the CI after this one gets merged. |
We can merge it as is. |
Backport of #70002 to release/11.0
/cc @ilonatommy @snemeckayova
Give QuickGrid paginator navigation an accessible name
Name paginator landmarks and enable application-specific accessible names.
Description
QuickGrid’s
Paginatorcurrently renders an unnamed navigation landmark. This change supplies the default accessible name"Pagination"and adds a publicAdditionalAttributesparameter so applications can name the internal navigation element usingaria-labeloraria-labelledby.The attribute-forwarding API is necessary to address the multiple-grid scenario, not merely an optional extension to the default-label fix. A fixed
"Pagination"label would leave paginators for different grids indistinguishable by name. Applications need to supply contextual names, such as"Orders pages"and"Customers pages", or reference existing headings.This follows the established implementation in other ASP.NET Core components. The following precedents already exist on the backport branch:
QuickGrid itself exposes the exact same parameter declaration in
aspnetcore/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor.cs
Lines 146 to 149 in 218f1e4
It forwards these attributes to its
<table>throughAdditionalAttributes:aspnetcore/src/Components/QuickGrid/Microsoft.AspNetCore.Components.QuickGrid/src/QuickGrid.razor
Line 13 in 218f1e4
NavLink exposes the same public dictionary parameter, documented as attributes added to the generated
<a>elementaspnetcore/src/Components/Web/src/Routing/NavLink.cs
Lines 32 to 37 in 218f1e4
InputBase exposes the same public parameter
aspnetcore/src/Components/Web/src/Forms/InputBase.cs
Lines 33 to 36 in 218f1e4
InputText forwards it to the actual
<input>usingbuilder.AddMultipleAttributes(1, AdditionalAttributes), allowing applications to provide accessible names and descriptions.The backport therefore applies an existing component convention to a missing accessibility customization point rather than introducing a new configuration mechanism.
Fixes dotnet/aspnetcore-scenario-tests#152.
Customer Impact
Screen-reader users can move between navigation regions using a list of their names. Without a name, users cannot tell which region contains the pagination controls. If paginators for different grids all have the same name, users cannot tell which grid each paginator controls.
The W3C ARIA Authoring Practices Guide, “Landmark Regions,” Step 3 states:
The guidance permits the same label for identical pagination controls above and below the same table. That exception does not address paginators controlling different content.
“There is one rare circumstance where providing the same label to multiple instances of a landmark can be beneficial: the content and purpose of each instance is identical. For example, a large search results table has two sets of identical pagination controls -- one above and one below the table, so each set is in a navigation region labelled Search Results.”
Using multiple QuickGrids on one page is a fully supported scenario (e.g. a dashboard with a separate Orders and Customers grid).
Without this backport, applications on .NET 11 cannot supply either naming attribute to
Paginatorthrough a supported component parameter. Adding only the default label would still leave those applications unable to follow the distinct-label guidance for different grids. The public parameter is the established Blazor mechanism for closing that gap and also permits localized names.Regression?
Risk
It does not change paging logic, control behavior, layout, or styling for existing callers. Applications that do not supply additional attributes receive the default name.
Verification
Packaging changes reviewed?