File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,8 @@ const App = () => {
128128 rootStyle= {styles .codeFieldRoot }
129129 keyboardType= " number-pad"
130130 textContentType= " oneTimeCode"
131+ autoComplete= {Platform .select ({ android: ' sms-otp' , default: ' one-time-code' })}
132+ testID= " my-code-input"
131133 renderCell= {({index, symbol, isFocused}) => (
132134 < Text
133135 key= {index}
Original file line number Diff line number Diff line change 11import {
2+ Platform ,
23 StyleProp ,
34 TextInput ,
45 TextInputProps ,
@@ -39,6 +40,10 @@ interface BaseProps {
3940}
4041
4142const DEFAULT_CELL_COUNT = 4 ;
43+ const autoComplete = Platform . select ( {
44+ android : 'sms-otp' ,
45+ default : 'one-time-code' ,
46+ } ) ;
4247
4348function CodeFieldComponent (
4449 {
@@ -84,6 +89,7 @@ function CodeFieldComponent(
8489 autoCapitalize = "characters"
8590 underlineColorAndroid = "transparent"
8691 maxLength = { cellCount }
92+ autoComplete = { autoComplete }
8793 { ...rest }
8894 value = { value }
8995 onBlur = { focusState . onBlur }
You can’t perform that action at this time.
0 commit comments