MudBaseInput: match inputs id with label's for attribute (#6249, #6460)#8672
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #8672 +/- ##
==========================================
+ Coverage 89.82% 90.09% +0.26%
==========================================
Files 412 418 +6
Lines 11878 12055 +177
Branches 2364 2365 +1
==========================================
+ Hits 10670 10861 +191
+ Misses 681 660 -21
- Partials 527 534 +7 ☔ View full report in Codecov by Sentry. |
|
@ScarletKuro @henon for review, not sure whether this can be considered a breaking change since this messes with input ids (and affected inputs no longer use Potential next steps:I saw the
Currently it always has a
|
|
Couldn't you have added I suppose the InputId makes adding an id slightly more discoverable? |
I think The Edit: because you have to know the inner workings of the components to know that |
danielchalmers
left a comment
There was a problem hiding this comment.
Thank you for this work in a very important area!!
Breaking changes are ok; If you think FieldId can be removed in a beneficial way it should be explored.
Don't have an opinion on that, as I don't know much accessibility flow, can only link a PR that added it #4107 and that i was also for the WCAG |
|
@brianseim If you could review this change, we'd appreciate it a lot. |
|
This is marked as breaking change but I don't understand what exactly got broken. Can you summarize for the migration guide? |
I think I was worried about the |
|
Thanks |


Description
Warning
Disclaimer: I am not an accessibility expert. As mentioned in a different discussion: I'm interested in improving the accessibility of MudBlazor for work because we are subject to accessibility audits.
This PR improves
input<->labelaccessibility by ensuringids provided to inputs and labels are equal and always present.These changes affect the following components:
MudTextField,MudNumericField,MudAutocomplete,MudSelect,MudColorPicker,MudDatePicker,MudTimePickerThe general logic is that the MudBlazor component generates its own id (or uses the user provided one, in this order:
UserAttributes>InputId> auto generated id) and passes it down to the controls that renderinputandlabel.Fixes #6249, fixes #6460
How Has This Been Tested?
Unit tests for affected components and the chrome issues tab + axe devtools for before/after comparison, e.g.:
Types of changes
Checklist
dev).