react-native-phone-input
react-native-phone-input copied to clipboard
Country code disappear on input
From few days ago, country code doesn't appear on phone input :

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'
/>
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
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.
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
@mohmdalfaha its not appearing on 0.2.2 also
it is appearing on 0.2.2. Commit fc938a603411bba3f4ee58de391b31b52d7f594c
@simonasdev I checked on this, country code not appearing on this
@simonasdev I reset my cache, its appearing
We also downgraded to 0.2.2 because of this inconsistency.
I'm using the example model, I downgraded to 0.2.2 and reset the cache but still not working for me
Remove the module then reinstall it again
@affanhashone It worked, Thanks
After downgrade to 0.2.2 , run npm start -- --reset-cache