Skip to content

docs(decisions): make Input Field-aware (option A) + prototype - #630

Draft
interacsean wants to merge 4 commits into
mainfrom
docs/input-field-proposal
Draft

interacsean wants to merge 4 commits into
mainfrom
docs/input-field-proposal

Conversation

@interacsean

@interacsean interacsean commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Decision record and prototype for making Input Field-aware (option A). Follows #629.

Decision record

decisions/input-field.md records why option A (rewire Input in place, next minor, released as a fix) was chosen over adding a separate InputField, or changing only the docs and warnings.

Prototype (not ready to merge as-is)

  • Input renders Base UI's Field.Control. Inside a Field.Root it links the label, description and error, takes the field's name and disabled, and submits through Form.
  • When Field.Control renders it (render={<Input />}), Input keeps the old native element. The field still has one control, and a deprecation warning logs once per page.
  • input-field.test.tsx covers the common ways Input is composed with Field.
  • /showcase/input-field in the vite example shows the before and after side by side for 11 cases.

Notable result: noValidate does not stop Field validation, so a newly wired Input with type="email", min/max or required can now block onFormSubmit.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (cc749d5) #630 (d15c6d5) +/-
Coverage 89.3% 89.3% +0.0%
Test Execution Time 2m54s 2m43s -11s
Details
  |                     | main (cc749d5) | #630 (d15c6d5) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          89.3% |          89.3% | +0.0% |
  |   Files             |            228 |            229 |    +1 |
  |   Lines             |           7241 |           7252 |   +11 |
+ |   Covered           |           6471 |           6482 |   +11 |
+ | Test Execution Time |          2m54s |          2m43s |  -11s |

Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
packages/core/src/components/field/field.tsx 100.0% 0.0% - modified
packages/core/src/components/field/inside-field-control.ts 100.0% +100.0% 100.0% added
packages/core/src/components/input/input.tsx 100.0% 0.0% 100.0% modified

Reported by octocov

@interacsean interacsean changed the title docs(decisions): propose InputField and deprecating Input for v2 docs(decisions): make Input Field-aware (option A) Oct 22, 2026
@interacsean

interacsean commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

This is an impact assessment of fixing the odd-one-out unconnected nature of Input component, so that it is aware of Field, and its intended usage aligns with all other form input components we provide.

The prototype included in this PR (now) handles the situation where Input is provided as the render prop of Field.Control. Field.Control looks for this anti-pattern, sorts it out internally and emits a deprecation warning. This is largely to reduce the impact on the large number of consumers who already use the pattern we are moving away from

There are a number of implementations that will require a little more hand-holding, but it is manageable

(My guided) claude findings follow:

@interacsean
interacsean force-pushed the docs/input-field-proposal branch from c65c25d to 3bedd34 Compare October 23, 2026 05:33
interacsean and others added 3 commits October 23, 2026 16:34
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>
@interacsean
interacsean force-pushed the docs/input-field-proposal branch from 3bedd34 to 51ef488 Compare October 23, 2026 05:34
@interacsean interacsean changed the title docs(decisions): make Input Field-aware (option A) docs(decisions): make Input Field-aware (option A) + prototype Oct 23, 2026
Input now renders Base UI's Field.Control, so inside a Field.Root it links
the label, description and error, takes the field's name and disabled
state, and submits through Form. When Field.Control renders it
(render={<Input />}), it keeps the old native element so the field has one
control, and logs a once-per-page deprecation warning.

Adds a before/after showcase page and tests covering the common ways Input
is composed with Field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@interacsean
interacsean force-pushed the docs/input-field-proposal branch from cc57b39 to d77bdd2 Compare October 23, 2026 06:53
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