thegamenicorus / react-native-phone-input

Phone input box for React Native
https://www.npmjs.com/package/react-native-phone-input
MIT License
395 stars 449 forks source link

Flag is not changing with phone number #162

Open babitakapoor112 opened 3 years ago

babitakapoor112 commented 3 years ago

Hi, I am facing a problem while changing my phone number. when I pick a country from the modal Picker and tries to change my phon number then sometimes the phone number does not reflect with that country code. Also, my flag got vanish from the input. Please see the below screenshot https://user-images.githubusercontent.com/45659052/108027275-edd7c400-704f-11eb-8716-5ae6ad5b0082.png https://user-images.githubusercontent.com/45659052/108027355-0ea01980-7050-11eb-96d8-fa67afe34af1.png

unicornRainbows commented 3 years ago

Same issue..

aleyrizvi commented 3 years ago

Its happening on android only.

Working fine on IOS.

Facing same issue.

Roshdy commented 3 years ago

+1

Roshdy commented 3 years ago

I found the problem:

in PhoneNumber.js line: 48

isNumeric(n) {
   return !Number.isNaN(parseFloat(n)) && Number.isFinite(n);
}

should be:

isNumeric(n) {
   return !Number.isNaN(parseFloat(n)) && !Number.isFinite(n);
}

Number.isFinite needs to be negated

kovetskiy commented 3 years ago

https://github.com/rili-live/react-native-phone-input/pull/2

italoa7x commented 2 years ago

Has this problem been fixed?