I have a custom ponent like below
<Input
value={value}
style={styles.input}
secureTextEntry={passwordInput && !this.state.showPassword}
onChangeText={onChangeText}
autoCapitalize={disableAutoCapitalize ? 'none' : 'words'}
autoCorrect={!disableAutoCorrect}
editable={!notEditable}
/>
But when I try to set autoCapitalize to words it's not working, why?
<InputField
disableAutoCapitalize={false}
disableAutoCorrect
/>
I have a custom ponent like below
<Input
value={value}
style={styles.input}
secureTextEntry={passwordInput && !this.state.showPassword}
onChangeText={onChangeText}
autoCapitalize={disableAutoCapitalize ? 'none' : 'words'}
autoCorrect={!disableAutoCorrect}
editable={!notEditable}
/>
But when I try to set autoCapitalize to words it's not working, why?
<InputField
disableAutoCapitalize={false}
disableAutoCorrect
/>
Share
Improve this question
edited Oct 12, 2018 at 10:32
Roy Scheffers
3,90811 gold badges33 silver badges36 bronze badges
asked Oct 5, 2018 at 9:07
AnXDAnXD
2552 gold badges4 silver badges15 bronze badges
0
3 Answers
Reset to default 1disableAutoCapitalize
is passed in as a prop I assume.
You should use this.props.disableAutoCapitalize
.
<Input
value={value}
style={styles.input}
secureTextEntry={passwordInput && !this.state.showPassword}
onChangeText={onChangeText}
autoCapitalize={this.props.disableAutoCapitalize ? 'none' : 'words'}
autoCorrect={!disableAutoCorrect}
editable={!notEditable}
/>
It is working on iOS but not on Android(Galaxy S9), it looks like a react native bug.
Its a react native bug that is fixed after 0.61.5. But in short, remove keyboardType, if possible, then autoCapitaliz will work for you
See these issues for a backstory: https://github./facebook/react-native/issues/27510 https://github./facebook/react-native/issues/8932