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

Country code disappear on input

Open JordanProtin opened this issue 5 years ago • 12 comments

From few days ago, country code doesn't appear on phone input :

Capture d’écran 2019-07-10 à 11 14 10

Is this bug in relation with the new release ?

My package.json contains "react-native-phone-input": "^0.2.1"

EDIT : reproduce code

selectCountry = (country) => {
  this.phone.selectCountry(country.iso2);
}
<PhoneInput
  ref={ref => { this.phone = ref }}
  onPressFlag={this.onPressFlag}
  countriesList={Countries}
  textStyle={{ color: 'black' }}
  initialCountry='fr'
  value={value}
  onChangePhoneNumber={this.handleOnChangePhoneNumber}
  textProps={{
    returnKeyType: returnKeyType,
    keyboardType: "numbers-and-punctuation",
    onSubmitEditing: onSubmitEditing,
    blurOnSubmit: blurOnSubmit
  }}
/>
<ModalCountrySelector
  ref={ref => { this.myCountryPicker = ref }}
  data={pickerData}
  onChange={country => { this.selectCountry(country) }}
  cancelText={ I18n.t('actions.cancel') }
  pickerButtonColor='red'
/>

JordanProtin avatar Jul 10 '19 09:07 JordanProtin

Hi,

This bug is also observed with the version 0.2.4, using the Custom Library Picker example from the Readme: https://github.com/thegamenicorus/react-native-phone-input/blob/master/examples/CustomLibraryPicker/app.js

mateattilabarna avatar Jul 13 '19 16:07 mateattilabarna

I was having the same issue with version 0.2.4, so I have downgraded to the most recent stable version which is 0.2.2. In your case @JordanProtin , I think the issue is related to textProps.

mohmdalfaha avatar Jul 15 '19 09:07 mohmdalfaha

I think it is after merge of #102 where a new state variable was introduced and passed to to TextInput value prop, although it is not being set correctly

simonasdev avatar Jul 15 '19 13:07 simonasdev

@mohmdalfaha its not appearing on 0.2.2 also

affanhashone avatar Jul 27 '19 09:07 affanhashone

it is appearing on 0.2.2. Commit fc938a603411bba3f4ee58de391b31b52d7f594c

simonasdev avatar Jul 27 '19 09:07 simonasdev

@simonasdev I checked on this, country code not appearing on this

affanhashone avatar Jul 27 '19 09:07 affanhashone

@simonasdev I reset my cache, its appearing

affanhashone avatar Jul 27 '19 09:07 affanhashone

We also downgraded to 0.2.2 because of this inconsistency.

ziaulrehman40 avatar Aug 22 '19 12:08 ziaulrehman40

I'm using the example model, I downgraded to 0.2.2 and reset the cache but still not working for me

Abdulrahman-Khalid avatar Aug 23 '19 02:08 Abdulrahman-Khalid

Remove the module then reinstall it again

affanhashone avatar Aug 23 '19 21:08 affanhashone

@affanhashone It worked, Thanks

Abdulrahman-Khalid avatar Aug 25 '19 01:08 Abdulrahman-Khalid

After downgrade to 0.2.2 , run npm start -- --reset-cache

zgajo avatar Sep 05 '19 13:09 zgajo