react-native-otp-textinput icon indicating copy to clipboard operation
react-native-otp-textinput copied to clipboard

Weird behaviour when autofocus is set to true

Open REEDOOX opened this issue 4 years ago • 2 comments

Hello,

Thank you for making this module it's really great and simple to use. I have a slight problem when the autofocus property is set on OTPTextView like this:

<OTPTextView ref={(e) => (this.codeInput = e)} containerStyle={{ width: "100%", height: 65, paddingHorizontal: 10, }} autoFocus={true} handleTextChange={(code) => this.onOtpCodeChange(code)} inputCount={6} keyboardType={"phone-pad"} tintColor={"#A65FDB"} />

When running the app the keyboard is displayed when autoFocus is set to true, but the cursor keeps moving from 1 box to another for a period of time then goes back to the first box.

I checked the documentation and I couldn't find the autoFocus property. Is there a way I can implement this ?

REEDOOX avatar Nov 13 '20 16:11 REEDOOX

Hey, may I know which platform this issue is occurring whether in Android or iOS ? Also will it be possible for you to share a screen capture of the issue so that I may understand it more clearly ?

naveenvignesh5 avatar Jan 25 '21 10:01 naveenvignesh5

same issue here ..... platform - android

arjunsingh101 avatar Jan 07 '22 07:01 arjunsingh101

Yes on Android only

jacquesdev avatar Sep 17 '23 23:09 jacquesdev

This fix implement in this PR #16 has fixed the issue. You can explicitly pass autoFocus and it will only trigger focus for the first text field. Closing this now since there is not activity on this issue.

naveenvignesh5 avatar Jan 14 '24 15:01 naveenvignesh5