r5n-dev/react-native-otp-inputs

Android and iOS crashed when use two OTPInput view together with 4 and 6 numberOfInputs.

Closed this issue · 3 comments

Screenshot_1570772856

First OTPInputview is for 4 number and second is for 6 number.
4 DIgit OTPInputview working fine but If i try to write 5th word in second OTPInpuptview which has total 6 digit code so doesn't work and crashed.
Even If i use forceInput(), still not working.

@Parth-9711 could you share code? Because I can’t debug without any background.

      {this.state.isFourDigit == true ? (<OtpInputs
                                            ref={this.otpRef}
                                            selectTextOnFocus={false}
                                            focusedBorderColor={CommonColor.bgBorderGray}
                                            keyboardType='number-pad'
                                            style={{ backgroundColor: CommonColor.bgGray, borderColor: CommonColor.bgBorderGray, justifyContent: 'center' }}
                                            handleChange={code => this.mPassCodeData.mPassCodeValue = code}
                                            **numberOfInputs={4}**
                                        />
                                        ) : (<OtpInputs
                                            keyboardType='number-pad'
                                            ref={this.otpRef}
                                            style={{ backgroundColor: CommonColor.bgGray, borderColor: CommonColor.bgBorderGray, alignSelf: 'center' }}
                                            handleChange={code => this.mPassCodeData.mPassCodeValue = code}
                                            **numberOfInputs={6}**
                                        />
                                            )}

See this, i have two view with different numberofInputs but not working.

@Parth-9711 Sorry but still I couldn't reproduce this bug. Checkout @next version and give me a shout if this is still and issue.
I'm also curious if this is not related to passing same ref={this.otpRef} to 2 components.