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 open first time in android #218

Open hirendudhat03 opened 11 months ago

hirendudhat03 commented 11 months ago

Describe the bug A clear and concise description of what the bug is.

when go to first time in screen after click on input keyboard not open but when app minimize and open again keyboard open automatic after that app working fine.

Smartphone (please complete the following information):

JoaoLucas8760 commented 11 months ago

same bug here

JoaoLucas8760 commented 11 months ago

i resolved the bug with: 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..6c591d6 100644 --- a/node_modules/@twotalltotems/react-native-otp-input/dist/index.js +++ b/node_modules/@twotalltotems/react-native-otp-input/dist/index.js @@ -155,7 +155,7 @@ export default class OTPInputView extends Component { } componentDidMount() { this.copyCodeFromClipBoardOnAndroid();

gajjartejas commented 10 months ago

Here is the patch-package patch

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..cc4c29d 100644
--- a/node_modules/@twotalltotems/react-native-otp-input/dist/index.js
+++ b/node_modules/@twotalltotems/react-native-otp-input/dist/index.js
@@ -155,7 +155,8 @@ export default class OTPInputView extends Component {
     }
     componentDidMount() {
         this.copyCodeFromClipBoardOnAndroid();
-        this.bringUpKeyBoardIfNeeded();
+        setTimeout(() => this.bringUpKeyBoardIfNeeded(), 100);
+
         this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.handleKeyboardDidHide);
     }
     componentWillUnmount() {
deeps0903 commented 4 months ago

not works

Mrudula-Nemani commented 3 months ago

same bug here.