fix(TextInput): merge caller inputProps with the React Aria props - #1360
Merged
Conversation
Every field rendering TextInputBase passed its hook's props down under the same `inputProps` name as the caller's, so one side overwrote the other wholesale. TextInput, TextArea, NumberInput and CommandTextArea dropped the caller's `inputProps`; PasswordInput and SearchInput did the reverse and replaced the hook's value tracking, ids and ARIA attributes with it. Each now merges the two with `mergeProps`, so a key the caller sets wins and event handlers are chained rather than replaced. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NcSWqpSaC4Mvn4Fdd2mDat
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 33ece2f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
📦 NPM canary releaseDeployed canary version 0.0.0-canary-69f25fb. |
Contributor
🏋️ Size limit report
Compared against main at 9b2daec — run 32863692246, 2026-08-25T15:06:14Z.To see which modules changed, download the size-limit-statoscope-report artifact from this run and open report.html. |
Contributor
🧪 Storybook is successfully deployed!
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe changes
Follow-up to #1357, which flagged this: every field that renders
TextInputBasepasses its React Aria hook's props down under the sameinputPropsname the caller uses, and nothing merged the two — one side silently replaced the other, in whichever direction the JSX happened to order them.TextInput,TextArea,NumberInput,CommandTextArea{...restProps}theninputProps={hookProps}inputPropswas dropped entirelyPasswordInput,SearchInputinputProps={hookProps}then{...rest}The second row is the damaging one: passing
inputPropsto aPasswordInputquietly unwired the field.Each component now merges the two with the repo's
mergeProps, so a key the caller sets wins and event handlers are chained rather than replaced.data-input-typesits between them, so it still lands by default but stays overridable.ColorInputalso rendersTextInputBase, but itsCubeColorInputPropsdeliberately doesn't exposeinputProps, so it's untouched.Checklist
No stories added — this changes no rendered default, only what happens when a caller passes
inputProps, which is not a story-visible state.Closes: N/A
Other information
New spec:
src/components/fields/input-props.test.tsx— 20 cases across the six components (caller props reach the input; the React Aria wiring survives, checked by typing and by the input keeping its generatedid; a handler on a key the hook also sets is chained, not replaced; plusautoCompletethroughinputPropsand an explicit prop beating the same key ininputProps).11 of the 20 fail on
main— verified by stashing only the six source files and re-running. The two "keep the React Aria wiring" failures arePasswordInputandSearchInput, exactly the two-sided bug above.The
autoComplete-through-inputPropscase inautocomplete.test.tsxhad to renderTextInputBasedirectly becauseTextInputdroppedinputProps; it stays there as aTextInputBase-level guard, with theTextInputroute now covered in the new spec.Verification run locally:
pnpm test— 101 files, 2185 passed, 1 skippedpnpm test:browser— 12 files, 139 passedpnpm lint— Prettier clean, oxlint exits 0 (only pre-existing warnings in unrelated files)pnpm build,pnpm size— pass (511.81 kB / 515 kB limit)pnpm exec tsc --noEmit— 18 errors, same count asmain(all pre-existing, none introduced in touched files)pnpm audit-docs— output byte-identical tomainGenerated by Claude Code
Note
Medium Risk
Touches core form/search/password inputs and accessibility wiring; behavior change only when callers pass
inputProps, but that path previously broke fields or ignored custom props.Overview
Fixes a bug where
inputPropsfrom callers and React Aria hook props fought over the same name on sixTextInputBase-based fields. Some components dropped the caller’sinputPropsentirely;PasswordInputandSearchInputdropped the hook’s props, which broke value tracking, ids, and ARIA wheninputPropswas passed.Each affected component now
mergePropshook props, internal markers likedata-input-type(and combobox ARIA onCommandTextArea), thenuserInputProps, so caller keys win and shared handlers (e.g.onChange) are chained instead of replaced. Docs describe that merge behavior; a patch changeset andinput-props.test.tsxcover all six components (passthrough, wiring survives typing, handler chaining,autoCompleteprecedence).Reviewed by Cursor Bugbot for commit 33ece2f. Bugbot is set up for automated code reviews on this repo. Configure here.