From c0b8ab1302064617df3233a4f6330d8db0db1b05 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 12 Sep 2025 05:00:29 +0000 Subject: [PATCH] fix: allow external onChange to override PhoneNumberInput's internal handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- packages/components/src/ui/phone-input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/ui/phone-input.tsx b/packages/components/src/ui/phone-input.tsx index 9c2f96bd..15820b3c 100644 --- a/packages/components/src/ui/phone-input.tsx +++ b/packages/components/src/ui/phone-input.tsx @@ -134,10 +134,10 @@ export const PhoneNumberInput = ({ )} data-slot="input" aria-label={props['aria-label']} - {...props} value={display} onChange={handleInputChange} onKeyDown={handleKeyDown} + {...props} /> ); };