Name the remaining twelve switches, and guard the trap that unnamed them

Fixkamo-internal
Shipped
September 2, 2026 at 5:36 AM UTC
Author
Kamo
Commit
ec60bfa

MUI 7 drops `inputProps` on Switch — silently, with no warning and no type error, so the aria-label never reaches the DOM. Nearly every switch in this app puts its visible words in a sibling Typography or an adjacent table column rather than in a <label>, so there was no accessible name to fall back on: a screen reader announced "checkbox, not checked" and nothing more. Twelve of them shipped that way, across billing, sounds, notes, widgets, mortgage, receivables, org and platform-admin screens. One of the twelve even carried a comment explaining why the label was needed. `slotProps.input` carries it. The guard is the point of this commit. A grep for the aria-label string found ten; the guard found twelve, because two wrote the key in double quotes. It is Switch-only, and deliberately so — the same line on a Checkbox, Radio, TextField or InputBase works, and failing those too would send somebody editing twenty call sites that were never broken. Which components drop which prop was measured on 7.3.10 rather than assumed, and the table is in the guard's header so the next person need not re-derive it. Nothing else catches this: not a crash, not a type error, and it reads as correct. No test imports any of the twelve, so the change is carried by the typecheck and the guard; the full suite (371 files, 4664 tests) is green either way.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing