Description
The library incorrectly handles phone numbers with country code +7, which is shared by Russia and Kazakhstan.
Steps to Reproduce
- Select phone input
- Enter +7
- Continue typing:
- Enter 7 and any number → flag switches to Russia
Expected Behavior
- Library should NOT immediately assign Kazakhstan on +7
- It should wait for next digits before deciding country
- Correct logic:
- +7 6xx / +7 7xx → Kazakhstan
- +7 9xx → Russia
Actual Behavior
- Default country becomes Kazakhstan immediately after +7
- Incorrect or delayed switching of flags
- Creates confusion for users
Suggestion
- Delay country detection until sufficient digits entered
- OR allow disabling auto-detection
- OR prioritize prefix-based logic instead of default country
Impact
- Incorrect country flag shown
- Bad user experience
- Wrong data may be submitted
Environment
- Library: react-phone-input-2
- Version: react-phone-input-2: ^2.15.1
Description
The library incorrectly handles phone numbers with country code +7, which is shared by Russia and Kazakhstan.
Steps to Reproduce
Expected Behavior
Actual Behavior
Suggestion
Impact
Environment