views:

192

answers:

6

Here are some examples of what I mean:

google.com - focus is set on the "search" box

gmail.google.com - focus is set on the "user name" field (actually, most web email clients do this).

stackoverflow, ask a question - focus is set on the "title" box.

Sometimes, this is a convenient feature - e.g., on Google. From a usability standpoint, however, is it really considered a good feature to have on login pages?

Personally, I have often entered my user name, started to enter my password, then the page finished loading and had focus put back onto the user name field. Unfortunately, since I have complex passwords that force me to look at the keyboard while typing, I fail to notice when focus shifts. I often wind up typing my password in the unmasked user name field for anyone standing behind me to see.

Another situation, less dangerous but still annoying, is when I'm typing a url in my address bar while my homepage is still loading. As soon as it finishes, however, and if I'm not done entering the url, focus is stolen from me and put on some other field.

Should websites and/or browsers be programmed so that focus won't change if the user is already interacting with the site or the browser? Do problems like this bother ordinary (i.e., non-programmer) users?

+1  A: 

I think only we programmers have the habit of typing even before the page gets loaded ;-) Most of the non-programmers friends I have wait till they see the "Completed" signal from the loading area.

But the 2 issues above are les annoying than having to move our mouse pointer/use tab everytime to type in what we want (username, password) in sites which do not have focus on a particular control.

"Should websites and/or browsers be programmed so that focus won't change if the user is already interacting with the site or the browser? "

I think browsers should be enabled to do this than the websites. Becauase it will be another trip back to server and can be frustrating for connections with low speed.

Overall I think this is just another minor issue/annoyance which we can live with. As I said only we programmers jump in type even before the page loads. Most of my friends dont know that they can type before the page gets loaded :)

Shoban
+3  A: 

I personally hate it when websites assume the focus. The main reason is that on my laptop, if I'm using the track pad and hit the backspace key it will automatically navigate back to the previous page. If focus has been placed on a textbox it will treat the backspace as tho I'm trying to delete a character.

My personal preference (and this has very little to do with best practice) is that it nothing should have initial focus, but the first tab will take it to the element that you want to have initial focus.

lomaxx
+2  A: 

The same happened to me in Gmail, I find it slightly annoying, especially since it should be easy to circumvent: In the OnLoad event handler, check if the input boxes (username or password) already contain text. If this is the case, do not change the focus.

As with all simple solutions, I would not be surprised if there were some strange side effects that render it unpractical, but I would give it a try anyway. Oh, and if it works, why don't you send an email to Google? ;-)

That being said, I consider this behaviour a usability glitch, something that is not a bug, but slightly annoying. Don't annoy your customers. Fix it.

Treb
+1  A: 

There are sites where you acutally have one usecase a normal user uses keyboard for (normal user - as some, like me, use keyboard to navigate also). Sites like Google search actually expect you to just enter what you're looking for and hit enter.

Sites with multiple input areas and multiple exit paths though sometimes put initial focus somewhere too, and then it gets annoying. It gets even worse if they haev some odd tabbing order of their input areas - so they actually force you to use mouse.

I personally don't see the changing of focus when site finishes it's loading as an issue, not for a general user. But, as I mentioned, if it's really useful, it's a matter of what's the usecase in your particular application. And this might be a matter of showing the application in it's beta-stage to some people and performing usability tests.

kender
+1  A: 

Yes, focus should default to the most likely place for a user to start typing. Not doing so is textbook bad UI design.

When focus defaulting interferes with something you're already doing, this isn't an inherent problem of focus defaulting, it's a failure of an inadequate implementation. This, among other reasons, is why I put together a generic 'smart' autofocus script that does things like leaving you the hell alone if you've already started typing.

(Yes, I know it's hairy. Most of the hairiness is dealing with cross-browser issues -- a failing of Firefox, actually, for once.)

chaos
+3  A: 

These are really two separate questions with different answers:

Q: Should focus be given to the input field the user is most likely to use?

A: Most definitely yes, if "most users" really is 90% or more.

Q: Should this happen when the webpage finishes loading?

A: No. The "onLoad" event is a pretty stupid place to put this. The input field should get the focus as soon as it appears - it's usually completely irrelevant when the page finishes loading. Just put a <script> tag that sets the focus right after the input element itself.

Michael Borgwardt