Skip to content

Commit

Permalink
Merge pull request #32 from anday013/fix/assign-otp-content-type
Browse files Browse the repository at this point in the history
feat: add `textContentType` prop as OTP to `TextInput`
  • Loading branch information
anday013 authored Jan 6, 2024
2 parents 7db6d76 + 5399ece commit 1ab3759
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/src/OtpInput/OtpInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ 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" ref={inputRef} autoFocus={autoFocus} style={OtpInput_styles_1.styles.hiddenInput} secureTextEntry={secureTextEntry} 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} testID="otp-input-hidden"/>
</react_native_1.View>);
});
1 change: 1 addition & 0 deletions src/OtpInput/OtpInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const OtpInput = forwardRef<OtpInputRef, OtpInputProps>((props, ref) => {
onChangeText={handleTextChange}
maxLength={numberOfDigits}
inputMode="numeric"
textContentType="oneTimeCode"
ref={inputRef}
autoFocus={autoFocus}
style={styles.hiddenInput}
Expand Down
1 change: 1 addition & 0 deletions src/OtpInput/__snapshots__/OtpInput.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ exports[`OtpInput UI should render correctly 1`] = `
}
}
testID="otp-input-hidden"
textContentType="oneTimeCode"
value=""
/>
</View>
Expand Down

0 comments on commit 1ab3759

Please sign in to comment.