tttstudios / react-native-otp-input

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

Keyboard not opening on android device #194

Open dhayaljaswantgit opened 1 year ago

dhayaljaswantgit commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch @twotalltotems/react-native-otp-input@1.3.11 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@twotalltotems/react-native-otp-input/dist/index.js b/node_modules/@twotalltotems/react-native-otp-input/dist/index.js
index 71580b8..49526e1 100644
--- a/node_modules/@twotalltotems/react-native-otp-input/dist/index.js
+++ b/node_modules/@twotalltotems/react-native-otp-input/dist/index.js
@@ -156,6 +156,7 @@ export default class OTPInputView extends Component {
     componentDidMount() {
         this.copyCodeFromClipBoardOnAndroid();
         this.bringUpKeyBoardIfNeeded();
+        setTimeout(() => this.bringUpKeyBoardIfNeeded(), 100);
         this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.handleKeyboardDidHide);
     }
     componentWillUnmount() {

This issue body was partially generated by patch-package.

ehdwns980416 commented 1 year ago

+1

Naman-Garaaz commented 1 year ago

+1

mkhotib20 commented 1 year ago

+1

jet2018 commented 1 year ago

+1

alexanderwassbjer commented 1 year ago

+1