tttstudios / react-native-otp-input

Tiny Javascript library which provides an elegant UI for user to input one time passcode.
MIT License
530 stars 239 forks source link

ClearInputs is not working perfectly #85

Closed Harikasai999 closed 3 years ago

Harikasai999 commented 4 years ago

Describe the bug To clear the inputs is not working. ClearInputs is not working

Code

isEmptyString = ()=>{
setCode("")
}
<OTPInputView
                            ref={updateRef}
                            autoFocusOnLoad
                            style={{ width: '100%', height: 100, }}
                            pinCount={6}
                            code={code}
                            codeInputFieldStyle={styles.underlineStyleBase}
                            codeInputHighlightStyle={styles.underlineStyleHighLighted}
                            onCodeFilled={(code => {
                                setCode(code)
                            })}
                        clearInputs={() => isEmptyString(code)}
                        />

Screenshots otp

ericdao37 commented 4 years ago

Hi @Harikasai999

Can you please check our clearInputs props in the index.d.ts file? its type is boolean. I think that you have used it incorrectly. Thank you /**