Various components: Let UserAttributes override generated ARIA attributes

Merged
DA
3mo ago
+148-13

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

  • required stays below the splat everywhere. It is native browser behaviour rather than an ARIA annotation, and it drives MudFormComponent validation and the label asterisk, not just the DOM. Keeping the pair separable is the point of the original change.
  • MudRangeInput's aria-label and id stay 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/EndInputAriaLabel remain the supported override path.
  • MudFileUpload's id stays below. The splat sits inside a @for, so a single caller id would land on every active input and break mudFileUpload.openFilePicker, which resolves by getElementById and no-ops silently on a miss.

Behaviour

beforeafter
no caller-supplied valuecomputed value renderedunchanged — the literal is still emitted, just earlier
caller supplies aria-required / aria-invalid / aria-describedbysilently discardedcaller's value wins
required attributefrom Requiredunchanged

Checklist:

  • I've read the contribution guidelines
  • My code follows the style of this project
  • I've added or updated relevant unit tests