Skip to content

Review 4791

Cindy Zhang edited this page Aug 23, 2026 · 1 revision

#4791 — feat(FormLayout): add defaultOptionality — mark only the exception

freddymeta · merged · view on GitHub

Verdict: approve · 2 rounds

These records predate the Review Presentation format for the most part, so the problem/solution/API/theme-target/breaking slots are only filled where the review itself carried them. Reviews from 2026-08-23 on use the full template.

Round 1 — dismissed · 2026-08-17

Thanks — FormLayoutContext is the right home, and dropping the enums and the asterisk cleaned this up.

One thing before it lands. Under defaultOptionality="required" the indicators disappear, but each input still derives aria-required from its own isRequired, so a field you didn't mark stays aria-required="false". Sighted users read "everything is required unless marked optional" and a screen reader hears required on only the few explicitly marked ones.

The inputs already read the context — they just need to resolve against it rather than their own prop alone:

const isFieldRequired = isRequired ?? optionality === 'required';
aria-required={isFieldRequired}

Worth keeping that to aria-required and not the native required attribute, so a layout-level policy doesn't quietly turn on browser validation bubbles. Unless you think submit should block too?

[Reviewed by Robohands]

Round 2 — approve · 2026-08-19

Thanks — this is right, and the shared hook is the correct shape. Checked every input in Chrome: unmarked fields announce required, native required never switches on.

[Reviewed by Robohands]

Clone this wiki locally