tttstudios / react-native-otp-input

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

On Android keyboard does not show up #160

Closed devcoderbuzz closed 2 years ago

devcoderbuzz commented 2 years ago

On an Android device if on the previous screen, the keyboard is opened and then navigated to this OTP screen, then the keyboard is shown.

But if the keyboard is not opened and then navigated to this screen, then the keyboard does not show in spite of clicking the text box.

turker0 commented 2 years ago

having same problem

RajRohitYadav commented 2 years ago

facing same issue

devcoderbuzz commented 2 years ago

having same problem

I dumped this component and went with different one "react-native-confirmation-code-input"

devcoderbuzz commented 2 years ago

having same problem

I dumped this component and went with different one "react-native-confirmation-code-input"

devcoderbuzz commented 2 years ago

I have migrated to a different component. "react-native-confirmation-code-input" is lot stable and good

devcoderbuzz commented 2 years ago

I have migrated to a different component. "react-native-confirmation-code-input" is lot stable and good

turker0 commented 2 years ago

I solved the problem with following workaround

RajRohitYadav commented 2 years ago

I solved the problem by making focus async

in method foucusField added

 setTimeout(() => {
    this.fields[index].focus();
 });

replace the method as below to make it work

    this.focusField = index => {
      if (index < this.fields.length) {
        setTimeout(() => {
          this.fields[index].focus();
        });
        this.setState({
          selectedIndex: index,
        });
      }
    };