I have a TextInput
field in react-native and I set autofocus
to true
so it automatically opens the keyboard when loaded.
What I want is that it opens a keyboard in uppercase letters (not only for the first characters, I want the uppercase key to be enabled so all letters are uppercase when typing)
According to the TextInput documentation I can specify which kind of keyboard to use with the keyboardType
prop.
There are several keyboards available: default, email, numeric, phone...
However none of them do what I want :(
How can I force the keyboard to be uppercase when focusing a TextInput?
Set editable false to read only TextInput.
Change the <button /> component's title prop to the string 'Submit' Add the prop clearButtonMode='always' to the <TextInput /> component — this will give us an option to clear the text at any time.
I overlooked Cherniv's comment when I was first here and ended up finding the same solution, so I'll make it an answer to give it more visibility.
<TextInput autoCapitalize='characters' />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With