Repository navigation
Fix validation summary list semantics in Blazor Identity pages - #68913
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
Pull request overview
This PR fixes an accessibility issue in the Blazor Web App “Individual Accounts” scaffolded Identity pages where <ValidationSummary> renders a <ul>, and previously received role="alert" via additional attributes—overriding its implicit list semantics and producing invalid ARIA markup. The change preserves list/listitem semantics by moving the live-region semantics to a wrapper element while still announcing validation errors.
Changes:
- Replaced
role="alert"on<ValidationSummary>with a surrounding<div role="alert" aria-atomic="true">. - Applied this update consistently across the affected Identity Account pages (login, registration, recovery, and manage pages).
File summaries
| File | Description |
|---|---|
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/ResetPassword.razor | Wraps the validation summary in an alert live region without overriding <ul> semantics. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/ResendEmailConfirmation.razor | Moves role="alert" off the <ul>-rendering component to a wrapper. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Register.razor | Preserves validation list semantics while keeping error announcements. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/SetPassword.razor | Uses an alert wrapper around validation summary for correct ARIA/list behavior. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/RenamePasskey.razor | Ensures <ValidationSummary> keeps implicit list semantics by removing role="alert". |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/Index.razor | Applies the wrapper-based live region approach to profile validation errors. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/EnableAuthenticator.razor | Wraps the summary in an alert region while keeping the <ul> role intact. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/Email.razor | Corrects ARIA semantics for the validation summary while preserving announcements. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/DeletePersonalData.razor | Moves alert semantics to a wrapper so the summary remains a valid list. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Manage/ChangePassword.razor | Prevents invalid role="alert" usage on the <ul> rendered by ValidationSummary. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/LoginWithRecoveryCode.razor | Updates summary markup to maintain list semantics while announcing errors. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/LoginWith2fa.razor | Applies the wrapper alert pattern for the validation summary. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Login.razor | Fixes the invalid ARIA role on the validation summary’s <ul> by using a wrapper. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/ForgotPassword.razor | Preserves list/listitem semantics for validation errors while keeping alert behavior. |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/ExternalLogin.razor | Moves alert semantics to a wrapper to avoid overriding <ul> roles. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
artl93
left a comment
There was a problem hiding this comment.
Accessibility. Approved.
@snemeckayova / @javiercn - do we need a wider pass on accessibility?
|
@artl93 these issues come from an accessibility pass I did for all the UI components on ASP.NET. We are working on getting these checks automated so they run as part of each build in 12+. |
|
Hi @snemeckayova. 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. |
* Fix validation summary list semantics (#68913) * Fix LoginWith2fa remember-machine checkbox label association (#68844) * Remove LoginWith2fa remember-machine checkbox label association * Formatting fix * Remove test * Fix installer background for bundles (#68931) --------- Co-authored-by: Soňa Nemečkayová <[email protected]> Co-authored-by: William Godbe <[email protected]> Co-authored-by: Youssef Fahmy <[email protected]>
Description
Moves the
alertrole from eachValidationSummary, which renders as aul, to anaria-atomicwrapper. This preserves the implicitlistandlistitemsemantics while continuing to announce validation errors.Fixes #67614
Customer Impact
Blazor Web Apps created with Individual Accounts no longer produce invalid ARIA markup for validation summaries. Assistive technologies can correctly identify both the validation alert and its list of errors.
Regression?
Risk
Verification
Packaging changes reviewed?