react-native-phone-input icon indicating copy to clipboard operation
react-native-phone-input copied to clipboard

Flag is not changing with phone number

Open babitakapoor112 opened this issue 4 years ago • 6 comments

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

babitakapoor112 avatar Feb 16 '21 09:02 babitakapoor112

Same issue..

unicornRainbows avatar Feb 16 '21 17:02 unicornRainbows

Its happening on android only.

Working fine on IOS.

Facing same issue.

aleyrizvi avatar Feb 17 '21 02:02 aleyrizvi

+1

Roshdy avatar Feb 20 '21 07:02 Roshdy

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

Roshdy avatar Feb 20 '21 08:02 Roshdy

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

kovetskiy avatar Feb 26 '21 05:02 kovetskiy

Has this problem been fixed?

italoa7x avatar Jan 04 '22 17:01 italoa7x