1

I'm using a TextInput in my React Native app with autocapitalize: 'characters'. It autocapitalizes all characters, but I'm still able to press the shift key (iOS), which switches to lowercase. I want to prevent the user from being able to switch to lowercase. Does anyone know if there's a way to do this?

gkeenley
  • 6,088
  • 8
  • 54
  • 129

1 Answers1

1

One of the workarounds could be following

export default function MyUpperCaseText() {
  const [text, setText] = React.useState("")
  return <TextInput value={text} onChangeText={(text)=>setText(text.toUpperCase())} />
}
Sameer Kumar Jain
  • 2,074
  • 1
  • 13
  • 22