thegamenicorus / react-native-phone-input

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

scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures. #114

Open MTajuddin96 opened 5 years ago

MTajuddin96 commented 5 years ago

Getting this error when index letter is pressed on the right side.

`` const PhoneInputTest=()=>{ let phone = React.createRef() let countryPicker = React.createRef()

const [timezone, setTimeZone] = useState(momentTz.tz.guess()) const [cca2, setcca2] = useState({ cca2: 'US' }) const [phoneNumber, SetPhoneNumber] = useState('')

function onPressFlag() { countryPicker.current.openModal(); } function selectCountry(country) { phone.current.selectCountry(country.cca2.toLowerCase()); setPhoneNumber(+ ${country.callingCode}) setcca2({ cca2: country.cca2 }); }

return( <View style={{ marginLeft: 20, marginRight: 20, borderWidth: 1, borderRadius: 5, borderColor: borderColor, }}> <PhoneInput ref={phone} onPressFlag={onPressFlag} value={phoneNumber} /> <CountryPicker ref={countryPicker} onChange={value => selectCountry(value)} translation="eng" cca2={cca2.cca2}

) } ``

khushbuthakur commented 5 years ago

Any update ?