Capitalize first letter in text input (Android)


#1

I have searched high and low for the answer to this problem to no avail. I am trying to make it so that when a text box has focus the mobile keyboard is set to capitalize the first letter. I DO NOT want it to only appear capitalized (text-transform), but actually have a capitalized value. Additionally, I don’t want to force the first letter to be capitalized if the user doesn’t want that.

It’s almost like I want the shift key to get pressed automatically whenever a text input gets focus.


#2

This is a setting that every user can set on their keyboard really. I don’t think you specify this in your text input. On android, you can press the “settings” icon on ur keyboard and in the menu that appears you could mark if you want the first letter to select shift automagically.


#3

So I checked out my Android setting for the keyboard and it is set to auto-capitalize the first word of each sentence. Android is treating my text input differently… I think what I am experience is common behavior.


#4

I actually found a pretty good work around on stackoverflow. Use a textarea with a limited height rather than a text input. I guess the OS expects that you’re going to be entering sentences into a textarea while it thinks an input is for something else.

<textarea style="height: 34px"></textarea>

Hope this helps someone else!