Closed devcoderbuzz closed 2 years ago
having same problem
facing same issue
having same problem
I dumped this component and went with different one "react-native-confirmation-code-input"
having same problem
I dumped this component and went with different one "react-native-confirmation-code-input"
I have migrated to a different component. "react-native-confirmation-code-input" is lot stable and good
I have migrated to a different component. "react-native-confirmation-code-input" is lot stable and good
I solved the problem with following workaround
const inputRef = useRef<OTPInputView>(null)
<OTPInputView autoFocusOnLoad={false ... />
useEffect(() => { if (inputRef.current) inputRef?.current?.focusField(0) }, [])
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,
});
}
};
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.