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

onCodeFilled is not working when automatically filling the code. #121

Closed abbyhilman closed 3 years ago

abbyhilman commented 3 years ago

Describe the bug i use this react-native-otp-verify for listerner sms and autofill like that, sms get for the state but function onCodeFilled it's not working if i enter the code manually it's work

<OTPInputView
                  secureTextEntry
                  keyboardType="numeric"
                  pinCount={4}
                  autoFocusOnLoad
                  clearInputs
                  code={this.state.otp} 
                  onCodeChanged={(token) => {
                      this.setState({
                        otp: token
                      })
                      console.log(this.state.otp)
                  }}
                  onCodeFilled = {(code => {
                    console.log(`Code is ${code}, you are good to go!`)
                  })}
                  placeholderCharacter={'X'}
                  placeholderTextColor={
                    this.props.items.theme.appColorTextLight
                  }
                />

I tested on Android 8