Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The <label>
spec (4.10.4) calls for explicitly-labeled elements to have an id
that matches the <label>
's for
attribute. The Identity components don't have id
set.
For example, the InputText
component of the Login
component doesn't set id="email"
to match the <label>
's for
attribute ...
<div class="form-floating mb-3">
<InputText @bind-Value="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="[email protected]" />
<label for="email" class="form-label">Email</label>
<ValidationMessage For="() => Input.Email" class="text-danger" />
</div>
Rendered ...
<div class="form-floating mb-3">
<input autocomplete="off" aria-required="true" placeholder="[email protected]" name="Input.Email" class="form-control valid" value="" style="background-image: url("moz-extension://dcb55c96-de40-4f2c-913f-d37cccad5aae/images/web_access/vault-input-disabled.svg") !important; background-repeat: no-repeat !important; background-position: calc(100% - 3px) center !important; background-size: 14px !important; cursor: text;">
<label for="email" class="form-label">Email</label>
</div>
Therefore, the control
and form
properties are null
...
When the InputText
element is provided with id="email"
, the form
and control
properties are set ...
Expected Behavior
InputText
elements (and any other labeled elements) have an id
matching the for
attribute of label
elements.
Steps To Reproduce
None ... it's a template thing.
Exceptions (if any)
None ... the labels just no-op.
.NET Version
8.0.100
Anything else?
No response