Reputation: 1001
I am working on a hybrid app and having a problem while testing in Android (4.4). I am using Ionic (AngularJS+Cordova).
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, but only if the user wants that.
It's almost like I want the shift key to get pressed automatically whenever a text input gets focus.
Upvotes: 1
Views: 1012
Reputation: 1580
You can set attribute autocapitalize="sentences"
on an input field to capitalize the first letter of each sentence.
autocapitalize
is the new attribute introduced in the HTML 5.3 which controls whether and how text input is automatically capitalized as it is entered/edited by the user.
Note that it doesn't affect behavior when typing on a physical keyboard. Instead, it affects the behavior of other input mechanisms, such as virtual keyboards on mobile devices and voice input.
Upvotes: 1
Reputation: 1001
The best solution I could come up with was to use a text-area input styles to look like a regular text-input. Android wants to capitalize text-areas automatically so this works.. even though it's a bit hacky.
Upvotes: 0