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

Setting phone input value not working properly

Open oormilavarma opened this issue 6 years ago • 2 comments

<PhoneInput keyboardType={'numeric'} initialCountry='in' value='+91' ref={(ref) => {this.phone = ref;}} onChangePhoneNumber={(number) => {this.setState({mobile_no: number})}} />

If I try to clear the phone input completely , the number is getting cleared and only the flag is resetting. And if I again choose the same country, the country code (or dial code) is not showing up. Is there any way I fix this?

oormilavarma avatar Jul 07 '18 15:07 oormilavarma

Could you please share how to reset it's value? Thanks in advance

GSolari79 avatar Oct 26 '18 04:10 GSolari79

Hello, it's possible to set an empty value through component inner set state

phoneInputRef.current!.setState({
    inputValue: '',
})

gimoteco avatar Nov 25 '19 20:11 gimoteco