Skip to content

finding(fields): five EDIT_WIDGETS widgets never read error, so inline text / boolean / date / datetime / time controls still report no aria-invalid #7126

Description

@os-warren

Found while implementing objectui#7008 (the factory now DELIVERS the declared error key). Filed rather than folded in, because #7008's ruling scopes that card to the factory destructure and its dispatch said this class should be reported, not glossed.

What

FieldEditWidget resolves a field type to one of 27 distinct widget components (EDIT_WIDGETS). After objectui#7008 the factory forwards the declared error key to whichever one it renders. Five of those 27 never read it, so for their field types aria-invalid is still never set and delivering the key is inert:

widget inline field types it serves
TextField text
BooleanField boolean, toggle
DateField date
DateTimeField datetime
TimeField time

Each destructures { value, onChange, field, readonly, ...props } and spreads toDomProps(props); error is not in DOM_PASS_THROUGH_KEYS, so it reaches the component and is discarded there.

Measured, with a control

Read from origin/main at 71d83a6b1 with git grep against an explicit ref (not the shared checkout):

  • census of the 27 EDIT_WIDGETS components for a word-boundary error match: 21 read it, 6 return zero;
  • CONTROL for the regex: the same query returns 5 hits on NumberField, 11 on LookupField, so a zero is a reading and not a broken instrument;
  • CONTROL for the zeroes: of the 6, UserField is a FALSE zero — it renders LookupField with {...props}, so it delivers error transitively and DOES mark. That leaves the five above. A naive census would have reported six and been wrong about one.

Why it matters — there is a live host

RequiredFieldsDialog (packages/plugin-kanban/src/RequiredFieldsDialog.tsx) opens on a kanban drop and renders whatever field types the target column made required. Since #7008 it hands the control its computed required-validation state. A required text field — the most common type in any object — therefore still shows the red "Required" hint to a sighted user and tells a screen-reader user nothing. The same holds for the grid inline editor and the detail page's inline edit, whose error producer (InlineFieldInput, PR #7109) is already wired.

This is the same defect and the same remedy as objectui#6803, which closed it for NumberField with aria-invalid={!!error || !!refusal} one layer down, and objectui#4824 for the textarea dialog surface.

Note for whoever takes it

  • SelectField is the shape to copy: aria-invalid={!!error} placed AFTER the DOM spread so the widget's own computation wins, which makes a valid field say an explicit "false" rather than staying mute (the objectui#3222 discipline).
  • BooleanField and the three date/time widgets each render a real single control, so there is no composite-target question to settle first.
  • The message TEXT stays with the host — a widget reads error only to drive aria-invalid, per FieldWidgetComponentProps' own doc comment. Do not render it here.

Unassigned and ungraded on purpose.

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingpackage: fieldspriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions