Skip to content

Commit c0b8ab1

Browse files
committed
fix: allow external onChange to override PhoneNumberInput's internal handler
The PhoneNumberInput component was spreading props before its internal onChange and onKeyDown handlers, which prevented external handlers from overriding the internal ones. This caused issues in forms where the parent component needed to manage state updates. By moving the props spread to the end, external onChange handlers can now properly override the internal handler when needed, matching the behavior of other form components like TextField. This fixes the issue where phone number fields would immediately restore their original values when users tried to edit them in forms that manage their own state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0abcba2 commit c0b8ab1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/components/src/ui/phone-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ export const PhoneNumberInput = ({
134134
)}
135135
data-slot="input"
136136
aria-label={props['aria-label']}
137-
{...props}
138137
value={display}
139138
onChange={handleInputChange}
140139
onKeyDown={handleKeyDown}
140+
{...props}
141141
/>
142142
);
143143
};

0 commit comments

Comments
 (0)