react-international-phone
react-international-phone copied to clipboard
🐛 Fix Russian numbers being detected as Kazakhstan numbers
The problem
currently, Russian numbers are being guessed as Kazakhstani numbers. it should display the Russian flag for Russian numbers.
since Russia and Kazakhstan share the same country code, the only way to differentiate between them is by using the area code. ( for Kazakhstan it's 600 to 799 ).
Under an agreement with Russia signed on 11 June 2006, Kazakhstan was assigned zone codes 6xx and 7xx (x = 0 to 9) under the unified plan.
What has been done
- added Kazakhstan area codes ( starts with either 7 or 6 )
- changed the priority order to display Russian as the default country with a +7 country code ( required for the guessCountryByPartialNumber to change the country based on area codes )
Checklist before requesting a review
- [x] I have read the contributing doc before submitting this PR.
- [x] Commit titles correspond to the convention.
- [x] I have performed a self-review of my code.
- [x] Tests for the changes have been added (for bug fixes/features).
- [ ] Docs have been added / updated (for bug fixes / features).
Screenshots (if appropriate):