Paul Canavese
Ruby/Rails - MongoDB - Social - Mobile - Local
  • Home
  • Resume
  • Contact

Disabled Autocapitalize in Mobile Safari

2/11/2013

2 Comments

 
Picture
I spent quite a bit of time debugging this issue, so I'll toss this into the interwebs in case it can save someone else some hassle...

Mobile Safari supports HTML attributes that control which keyboard (and keyboard state) should be launched when a user clicks on a text input field.  Otherwise, it uses some smart defaults.  I wanted one of my fields to autocapitalize, but setting the attribute at the form level and/or input level had no effect:

<form action="/auth/login_cc" autocapitalize="words">
  <input autocapitalize="words" name="foobar" />
</form>

It turns out that Safari has a hidden feature in which it changes the default capitalization to lowercase if the string "login" appears anywhere in the form action.  Unfortunately, it also ignores any attributes as well, so it is impossible to override this except by changing the action name.

As I said, that took a while to track down.  I've submitted the bug to Apple...

2 Comments

    Archives

    February 2013
    December 2008
    September 2008
    August 2008

    Categories

    All
    Ios
    Mobile Safari

    RSS Feed

All site content (c) 2004-2012 Paul Canavese