-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Bug Report: Country Code Resets to Empty String After Phone Number Update
Description
When selecting certain countries (notably US/GB), the countryCode in MuiTelInputInfo resets to an empty string after updating the phone number, despite initially being set correctly.
Steps to Reproduce
- Initialize
MuiTelInputwith any default country - Select UK (or other affected countries) from the country selector
- Enter a phone number
- Observe the
countryCodein theonChangehandler
<MuiTelInput
onChange={(value, info) => {
console.log('Country Code:', info.countryCode); // Initially 'GB', then empty string
}}
/>Expected Behavior
- The
countryCodeshould remain consistent ('GB' for UK) throughout the component's lifecycle - The country code should not reset to an empty string after phone number updates
Actual Behavior
- The
countryCodeis initially set correctly ('GB' for UK) - After updating the phone number, the
countryCodebecomes an empty string - This causes UI flickering and inconsistencies in country code display
Environment
- Library Version:
9.0.0 - React Version:
18.3.1
Impact
- UI flickering when country code is displayed
- Inconsistent country code tracking
- Potential issues with form validation or country-specific logic
KyruCabading, agusu, GilliganL and babajaga3
Metadata
Metadata
Assignees
Labels
No labels