Standing Aginst Auto-Focus Inputs

Posted By: Mark Aplet 5 Comments December 16, 2008

Don't Auto-focus and make the web better

In the last few months I have read a number of articles from some major sites that appear to promote or advocate the use of an auto-focus input when a page loads as a "technique to improve your user interface". The technique usually relies on some form of onload event for the body tag to set the focus to a search field or a login field.

I will say right now this is not a good practice at all. Unless your creating a site (or page) where the first task a user should take is to search for something or login, this is a very bad thing to do. This technique is one that I would personally lump in an article more appropriately titled "10 things to kill your user interface designs"

Why the Auto-focus is a bad idea

Here are some of my top reasons why this approach belongs on the list of bad UI techniques. First the auto-focus takes a non traditional user (e.g. non-mouse, vision or cognitive disabilities.) out of the normal document flow. Users that tab to content on the page will find that they are not at the top of the page anymore. This can be confusing or disorientating to some users. Users of assistive technologies will suffer the most as they may not be able to tell where they are on the page at all. Some newer breads of CSS based designs put navigations and searches at the bottom of the document flow. This may present usability issues of it's own, but compounded with an auto-focused input and you may completely loose or disorientate a user.

Good UI design, and usability experts agree, that you should never break functionality of the browser just for your page. Placing focus on a form input breaks the standard UI expectations of users by removing the delete or backspace function allowing a user to go backwards in their history to the previous page.

Steps in the right direction

There has been efforts made to correct this by using smarter javascript's that detect when you have hit delete past the last character in the field and thereby returning you back in your history to the previous page.  I commend these javascript developers taking steeps in the right direction but more work needs to be done. This approach may work for some users but not all. Case in point: Sometimes I may start typing a few characters into a field, Then realize I made a mistake and hit delete more times than there are characters typed. A script like this would return me to the previous page and not just delete the content I wanted from a field and stop. If I had already filled out a lengthy form this could go really wrong. Thats not likely to be the case, but it's still annoying all the same.

Your better off ditching a script like unless it really makes sense for your application. If your google then I can see it being useful. Googles homepage is very minimal with most people going to do one thing — Search. This makes sense for google. Yahoo on the other hand does not make as strong of a case to me as there are numerous tasks that a user can make from the yahoo homepage. Yahoo still auto-focuses their search field so it either makes sense to them or they just don't care about non-traditional surfers. Based on my mobile experience with yahoo, I would guess they really do not care unless your a traditional user. But that is just my two cents.

What are your thoughts? Agree? Disagree? Good and bad examples? You are all surfing veterans, so your feedback is most valuable. Feel free to let me have it.

Offsite Resources

Tags: Accessibility · usability

5 comments so far ↓

  • 1 Mike Robinson // Dec 16, 2008 at 2:12 PM
    I agree 100% with this. It should be carefully considered even with the sites that would at first appear to benefit from such a feature. For example, I hate this feature applying to the Twitter homepage as it is an instant update to my profile. If I accidently mis-click onto the page instead of say the address bar or search box, type something and hit enter: boom, my followers get a completely random update that I didn't intend. While I understand the positive side of this auto-focus, forms that use the information like that should not utilize it.
  • 2 Peter Anselmo // Dec 17, 2008 at 10:51 AM
    First and most importantly, the image at the top of this post is awesome.

    As far as the actual post goes, I only about 50% agree. I like that Yahoo! mail auto focuses on the login field, and I get annoyed if it doesn't load properly and I have to click in. Same thing with Facebook. However, I suppose those fit into the category you mentioned of "one thing" websites. I've never even noticed the auto focus on the Yahoo! homepage (which I visit often) because I'm always using a mouse to navigate.

    You mentioned non-traditional and disabled users being affected by this Javascript technique. Aren't these these the same set of users most likely not to have Javascript enabled? I feel like the people most affected would be those using full-powered browsers but still browsing using keystrokes: a very small group of users. I may be wrong (and the previous comment is certainly valid), but I don't see many users even noticing.
  • 3 Peter Anselmo // Aug 23, 2010 at 9:41 AM
    Okay, I just had a really bad experience with this. GoDaddy.com focuses your input to the domain search field, but it does it after the page finished loading. This is terrible, As many many times, I'll begin entering my username and password to log in to my account, and it will change my focus to the search midway through. Because of this, this morning I did a search for my password! Grrrr.
  • 4 Alexander Byndyu // Jan 18, 2012 at 2:03 AM
    Say it to google.com :)

    User will click on search field anyway that's why they use autofocus.
  • 5 Mark Aplet // Jan 18, 2012 at 7:50 PM
    As I mentioned in my post, Google is one of those exceptions to the rule that makes perfect sense. Amazon might be another case where auto-focus is acceptable. For most sites, this is not the case. These are the cases that I am speaking to.

Leave a Comment

Leave this field empty:

Theme Design By Mark Aplet

Super Powered by Mango Blog

sufficient