Closed DavitVosk closed 6 years ago
ok it worked. I was missing something in my code...
Hey could you tell me what exactly was missing in your code? I couldn't get mine to focus for some reason, even when I ran it in componentDidMount()
@xiurobert I was calling this.phoneRef.focus()
instead of () => this.phoneRef.focus()
. Hope this will help you too
I'm trying to get it to focus in componentDidMount()
but I'm failing to do so on iOS only. On android, it focuses completely fine.
Hi there.
I have some problem with focusing phone input when needed. My code is following:
<PhoneInput ref={ref => (this.phoneRef = ref)} onChangePhoneNumber={this.handleMobileChange.bind(this)} />
And when I call
this.phoneRef.focus()
I get undefined. Please help to find a solution. Thanks