xamous / react-native-smooth-pincode-input

A cross-platform, smooth, lightweight, customizable PIN code input component for React Native.
MIT License
406 stars 139 forks source link

Unexpected behavior SmoothPincodeInput component in Modal component #95

Open LemonLightyear opened 2 years ago

LemonLightyear commented 2 years ago

When I tap the input box in my app user interface, it will be closed my modal. It only happens when I tap the input pin, other parts of the modal are okay.

Here is my code snipped

<Modal>
  <View>
       <SmoothPinCodeInput
                  editable={editableCode}
                  ref={pinInput}
                  cellSpacing={10}
                  cellSize={50}
                  codeLength={4}
                  cellStyle={errorMessage ? styles.textErrorInput : styles.pinTextInput}
                  textStyle={errorMessage ? styles.textErrorStyle : styles.textStyle}
                  value={code}
                  cellStyleFocused={{}}
                  onTextChange={code => this.setState({ code, errorMessage: null })}
                  onFulfill={this._checkCode}
         />
  <View>
</Modal>

checkCode function is for validation OTP matching