The Blazor Web App (Individual auth) two-factor login page wraps the "Remember this machine" checkbox in a <label> that carries for="remember-machine", but nothing on the page has id="remember-machine". Because the label declares a for, the browser does not fall back to the implicit wrapping association, so the checkbox ends up with no associated label: screen readers announce an unlabeled checkbox and clicking the visible text does not toggle it.
Source: src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/LoginWith2fa.razor (the <div class="checkbox mb-3"> block).
<label for="remember-machine" class="form-label">
<InputCheckbox @bind-Value="Input.RememberMachine" />
Remember this machine
</label>
The InputCheckbox renders name="Input.RememberMachine" and id Input_RememberMachine, never remember-machine.
Expected
The visible "Remember this machine" text labels the checkbox, so an accessible-name lookup finds the control and clicking the text toggles it. The Login page's "Remember me" checkbox already does this correctly with a wrapping label and no for:
<label class="form-label">
<InputCheckbox @bind-Value="Input.RememberMe" class="darker-border-checkbox form-check-input" />
Remember me
</label>
Actual
for="remember-machine" resolves to no element, so the checkbox has no accessible name.
Steps to reproduce
- Create a Blazor Web App with Individual auth (Server or Auto interactivity).
- Register and confirm a user, enable authenticator 2FA.
- Log out, log in, reach
/Account/LoginWith2fa.
- Try to locate the checkbox by its label (for example Playwright
GetByLabel("Remember this machine")): it is not found.
Suggested fix
Remove for="remember-machine" (matching Login.razor's "Remember me"), or add id="remember-machine" to the InputCheckbox.
Build validated
Branch main, build 20260630.1, SDK 11.0.100-preview.7.26330.101, ASP.NET Core packages 11.0.0-preview.7.26330.101.
A search for remember-machine and Remember this machine found no existing issue.
The Blazor Web App (Individual auth) two-factor login page wraps the "Remember this machine" checkbox in a
<label>that carriesfor="remember-machine", but nothing on the page hasid="remember-machine". Because the label declares afor, the browser does not fall back to the implicit wrapping association, so the checkbox ends up with no associated label: screen readers announce an unlabeled checkbox and clicking the visible text does not toggle it.Source:
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/LoginWith2fa.razor(the<div class="checkbox mb-3">block).The
InputCheckboxrendersname="Input.RememberMachine"and idInput_RememberMachine, neverremember-machine.Expected
The visible "Remember this machine" text labels the checkbox, so an accessible-name lookup finds the control and clicking the text toggles it. The Login page's "Remember me" checkbox already does this correctly with a wrapping label and no
for:Actual
for="remember-machine"resolves to no element, so the checkbox has no accessible name.Steps to reproduce
/Account/LoginWith2fa.GetByLabel("Remember this machine")): it is not found.Suggested fix
Remove
for="remember-machine"(matchingLogin.razor's "Remember me"), or addid="remember-machine"to theInputCheckbox.Build validated
Branch
main, build20260630.1, SDK11.0.100-preview.7.26330.101, ASP.NET Core packages11.0.0-preview.7.26330.101.A search for
remember-machineandRemember this machinefound no existing issue.