Various components: Let UserAttributes override generated ARIA attributes
Merged
DA
3mo ago+148+148+012345678901234567890123456789-13-13-01234567890123456789
Follows https://github.com/MudBlazor/MudBlazor/pull/13613, which moved aria-describedby, aria-invalid and aria-required above the @attributes="UserAttributes" splat on MudInput so a caller can override them. Blazor resolves duplicate attributes last-write-wins, so a literal written after the splat silently discards the caller's value, and one written before it acts as a fallback.
Deliberately unchanged
requiredstays below the splat everywhere. It is native browser behaviour rather than an ARIA annotation, and it drivesMudFormComponentvalidation and the label asterisk, not just the DOM. Keeping the pair separable is the point of the original change.MudRangeInput'saria-labelandidstay below. Their values differ per input ("Start"/"End",-start/-end), and one dictionary cannot express two values for one key — a caller value would be duplicated onto both halves, breaking the distinct accessible names and producing a duplicate DOM id.StartInputAriaLabel/EndInputAriaLabelremain the supported override path.MudFileUpload'sidstays below. The splat sits inside a@for, so a single caller id would land on every active input and breakmudFileUpload.openFilePicker, which resolves bygetElementByIdand no-ops silently on a miss.
Behaviour
| before | after | |
|---|---|---|
| no caller-supplied value | computed value rendered | unchanged — the literal is still emitted, just earlier |
caller supplies aria-required / aria-invalid / aria-describedby | silently discarded | caller's value wins |
required attribute | from Required | unchanged |
Checklist:
- I've read the contribution guidelines
- My code follows the style of this project
- I've added or updated relevant unit tests