iOS autocapitalize Problem

  • 2
  • Problem
  • Updated 6 years ago
  • Not a Problem
Hello PGBuild Friends,

I have posted this question on the Google Group for PhoneGap and gotten only one reply, so I thought I'd cross-post here. Any ideas?

-----------------------------------------------------------------------------
We are seeing some very strange behavior using PhoneGap 3.6.3. We have a web form that is really pretty simple. It just has 4 text boxes in a row (input, type=text) that have autocapitalize="words" (which is the default behavior for autocapitalize). If we use iOS 8.1.2 on an iPhone and launch Safari and enjoy this form, everything works as expected. What happens is that when you tab into the first textbox, the shift key is toggled and if you type on a letter you get a capital letter, and then the shift key automatically becomes untoggled. Then, when you tab to the next input or tap to get into the next input, the shift key is again automatically toggled. This is the correct behavior.

However... If you use a PhoneGap 3.6.3 app with the in-app-browser and browse to that very same page, this is what happens: You tap into the first text field and the shift key is toggled by default. Then you type a letter and you get a capital letter. So far, so good. Then when you tab into the next field or tap into any input type=text, the shift key is *not* toggled by default. If you try this again and do not type a letter at all in the first field, this problem does not occur.

There is another way to describe this behavior and it is this: When using the in-app-browser and you tap into a text field that has any value in it at all, and then you tab or tap into another text field, the autocapitalize does not kick in. If you go back to the first text field and clear out the value and then tab or tap, then it works and you get the shift key toggled in the second text field.

Now, here's one more detail... This does not only happen with the in-app-browser. It also happens with any HTML5/css app right inside a PhoneGap 3.6.3 app. Yep, it's true - autocapitalize is just a big crazy mess inside of PhoneGap 3.6.3 whether you use the in-app-browser or not. Using the in-app-browser is just a very handy way to demonstrate that this bug only occurs inside PhoneGap and does not have to do with iOS or mobile Safari itself.

https://groups.google.com/forum/#!sea...
-----------------------------------------------------------------------------
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
  • bugged

Posted 6 years ago

  • 2
Photo of Mattias Lindsjö

Mattias Lindsjö

  • 5 Posts
  • 0 Reply Likes
Hi!

Try using autocapitalize="words" on the input fields. It solved my problem!

mattias lindsjö
fivestarday
Photo of Ondřej Trávníček

Ondřej Trávníček

  • 1 Post
  • 0 Reply Likes
Hi, we have exactly same problem.
Attribute autocapitalize="words" solved this problem only partialy. Now if you use "tab" button to jump into another text input it works ok, but if you select another text input manualy it does not.