Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uppercase Keyboard when focusing a TextInput

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)

enter image description here

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?

like image 742
Sembei Norimaki Avatar asked Sep 21 '17 16:09

Sembei Norimaki


People also ask

How do I make text not editable in React native?

Set editable false to read only TextInput.

How do I clear TextInput in React native?

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.


1 Answers

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' />

like image 156
Rick Conrad Avatar answered Sep 20 '22 23:09

Rick Conrad