react-international-phone icon indicating copy to clipboard operation
react-international-phone copied to clipboard

🐛 Fix Russian numbers being detected as Kazakhstan numbers

Open rezk2ll opened this issue 9 months ago • 2 comments

The problem

currently, Russian numbers are being guessed as Kazakhstani numbers. it should display the Russian flag for Russian numbers.

Screenshot from 2024-05-28 14 24 23

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 ) Screenshot from 2024-05-28 14 19 53
  • 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):

Screenshot from 2024-05-28 14 17 24 Screenshot from 2024-05-28 14 17 07 Screenshot from 2024-05-28 14 16 51 Screenshot from 2024-05-28 14 16 38

rezk2ll avatar May 28 '24 13:05 rezk2ll