We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch react-native-otp-entry@1.4.1 for the project I'm working on.
react-native-otp-entry@1.4.1
Environment: ANDROID Error message: Error while updating property 'autoComplete'
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-otp-entry/dist/src/OtpInput/OtpInput.js b/node_modules/react-native-otp-entry/dist/src/OtpInput/OtpInput.js index 4c8bc37..4933e4f 100644 --- a/node_modules/react-native-otp-entry/dist/src/OtpInput/OtpInput.js +++ b/node_modules/react-native-otp-entry/dist/src/OtpInput/OtpInput.js @@ -35,6 +35,8 @@ exports.OtpInput = (0, react_1.forwardRef)((props, ref) => { </react_native_1.Pressable>); })} </react_native_1.View> - <react_native_1.TextInput value={text} onChangeText={handleTextChange} maxLength={numberOfDigits} inputMode="numeric" textContentType="oneTimeCode" ref={inputRef} autoFocus={autoFocus} style={OtpInput_styles_1.styles.hiddenInput} secureTextEntry={secureTextEntry} autoComplete="one-time-code" testID="otp-input-hidden"/> + <react_native_1.TextInput value={text} onChangeText={handleTextChange} maxLength={numberOfDigits} inputMode="numeric" textContentType="oneTimeCode" ref={inputRef} autoFocus={autoFocus} style={OtpInput_styles_1.styles.hiddenInput} secureTextEntry={secureTextEntry} + // @ts-ignore + autoComplete={react_native_1.Platform.OS === 'ios' ? "one-time-code" : "sms-otp"} testID="otp-input-hidden"/> </react_native_1.View>); }); diff --git a/node_modules/react-native-otp-entry/src/OtpInput/OtpInput.tsx b/node_modules/react-native-otp-entry/src/OtpInput/OtpInput.tsx index 0a07e92..7d3ea19 100644 --- a/node_modules/react-native-otp-entry/src/OtpInput/OtpInput.tsx +++ b/node_modules/react-native-otp-entry/src/OtpInput/OtpInput.tsx @@ -1,5 +1,5 @@ import { forwardRef, useImperativeHandle } from "react"; -import { Pressable, Text, TextInput, View } from "react-native"; +import { Platform, Pressable, Text, TextInput, View } from "react-native"; import { styles } from "./OtpInput.styles"; import { OtpInputProps, OtpInputRef } from "./OtpInput.types"; import { VerticalStick } from "./VerticalStick"; @@ -83,7 +83,8 @@ export const OtpInput = forwardRef<OtpInputRef, OtpInputProps>((props, ref) => { autoFocus={autoFocus} style={styles.hiddenInput} secureTextEntry={secureTextEntry} - autoComplete="one-time-code" + // @ts-ignore + autoComplete={Platform.OS === 'ios' ? "one-time-code" : "sms-otp"} testID="otp-input-hidden" /> </View>
The text was updated successfully, but these errors were encountered:
In the ios how can I auto fill the code using this npm? @anday013
Sorry, something went wrong.
@iyyanarCommuniti it gets it out of the box
Successfully merging a pull request may close this issue.
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
react-native-otp-entry@1.4.1
for the project I'm working on.Environment: ANDROID
Error message: Error while updating property 'autoComplete'
Here is the diff that solved my problem:
The text was updated successfully, but these errors were encountered: