Skip to content

Fix form submission and field wiring (#66, Part 1) - #67

Merged
n4ff4h merged 11 commits into
devfrom
fix/66-part1-forms
Nov 17, 2026
Merged

n4ff4h merged 11 commits into
devfrom
fix/66-part1-forms

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Part 1 of #66 (form submission and field wiring). There is one commit per item, and each adds a test that failed before the fix plus a changeset.

Item Change
1.1 New internal FieldValue (components/form/_field-value.tsx) is the one hidden field every composite control submits through: NumberInput, TagsInput, the combobox behind SearchableSelect/ApiSelect, every date and time picker, ColorPicker, IconPicker, SegmentedControl, DualListbox, Rating. It is disabled when the control or its FormField is disabled. It carries data-control pointing at the visible control, so findField (and ValidationSummary) can focus it from the field name. When its value changes it clears that field's server error in Form, through a small context in form-context.tsx. An empty array submits nothing but leaves a disabled marker, so an empty TagsInput can still be found by name. PickerShell's hidden render prop became submit: (name) => [name, value][].
1.2 PhoneInput submits the E.164 value; the formatted text box has no name.
1.3 A required TagsInput is natively required only while it has no tags.
1.4 ColorPicker/IconPicker no longer put required/aria-required on their trigger button. The axe tests now also scan the required FormField case.
1.5 DateRangePicker submits under names without name.
1.6 Form builds FormData with the submitter.
1.7 useOnChange was replaced by useParentChange(parent, value, waiting, reset). A dependent select clears only when its value was settled under the old parent: the field wasn't waiting, and the value didn't change in the same render.
1.8 Button/LinkButton always set data-slot="button", after the caller's props.
1.9 SlugInput/Radio merge a caller's aria-describedby instead of letting it win.
1.10 Select is now value: string | null and onValueChange(value, option), like SearchableSelect/ApiSelect (a minor changeset). The web demos and pages are updated.

Behaviour changes to note:

  • A multiple DatePicker with no days chosen now submits nothing (it used to submit name=""), like TagsInput/DualListbox.
  • PhoneInput's visible input no longer has a name.

Verification

  • pnpm lint, pnpm typecheck, node scripts/check-docs.mjs: pass
  • pnpm format:check: passes for every tracked file
  • pnpm test: 2,858 passed, 1 skipped; MCP 16 passed
  • pnpm build and pnpm --filter @javaabu/onu size: pass, with no budget changes
  • pnpm build:web: passes
  • e2e/nextjs build and test:ssr: clean in English and Dhivehi
  • pnpm e2e:chromium: all 528 a11y and Thaana tests pass. The 334 visual tests failed only because there are no local baselines (they live in the CI artifact), so the visual comparison wasn't run locally.

🤖 Generated with Claude Code

agent and others added 11 commits November 17, 2026 10:00
Disabled with the surrounding FormField, linked to the visible control so
Form and ValidationSummary can clear and focus it (#66, 1.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs (#66, 1.4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1.8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….10)

Matches SearchableSelect and ApiSelect. The web demos and pages are
updated for the new signature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@n4ff4h
n4ff4h merged commit 8155da8 into dev Nov 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant