WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Initial focus on search field?

for

From: Tim Harshbarger
Date: Sep 23, 2014 7:00AM


I will offer a dissenting viewpoint.

There is nothing inherently inaccessible about setting the focus to a specific field on a page.

It isn't a problem for screen reader users because screen readers don't even always start reading from the top of the page when focus isn't set to a field. I also think that, if a screen reader has spent much time on the web, they won't think a search field or any other field is likely to be the first item on the page.

It sounds like the problem for keyboard users is not so much setting focus to a field as much as it is ensuring a keyboard user knows where the focus is.

Certainly, it sounds like setting focus to a specific field might sometimes cause additional annoyance to keyboard users, but I'm not sure that is the same as being an accessibility issue. That sounds more like a usability issue. However, at the same time, it sounds like the reason for setting focus to a field is in order to make the user interface more usable.

I would actually tell the developer not to do any special kind of coding. Just set focus to the field and don't hide any focus indicators.

Thanks!
Tim