WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Initial focus on search field?

for

From: Robert Fentress
Date: Sep 29, 2014 9:21AM


How about changing tabindex so the search field is the second thing focus
is brought to when the tab key is pressed (after the skip link)? This may
make things easier for those keyboard-preferring users who want to quickly
get to the search field. The problem is that this is not the order things
appear in the page visually, since the first row of navigation links
appears above the search field. Even though the search field is very close
to the upper-right corner of the page, it seems bad to violate user's
expectations by having the focus move backward in the visual flow. . . so
that's probably out as a solution.

Folks here have raised the issue that the autofocus is bad for
keyboard-preferring users, but that seems counterintuitive to me. I am a
keyboard-preferring user myself, and I'd rather my focus be placed in that
field, because the links that precede it aren't ones I'd usually follow.
My understanding is that the requirement for focus to be placed in the
search field originally was based on specific usability testing for this
site, rather than general research. If we don't autofocus, that means a
keyboard-preferring user has to hit tab 13 times to get to the search
field, which research suggests is usually his/her preferred destination.

There are always many conflicting requirements in a page design--aesthetic,
political, usability preferences of different classes of visitors--and
there is often a certain thrownness to things, as Heidegger would say,
where we don't get to start from scratch, but have to work within existing
constraints. Certainly makes things interesting.

Thanks for the feedback. So is the consensus here that the autofocus
should just be removed altogether? Any creative solutions out there to
this conundrum, given that a major page redesign, where the
order/positioning of elements on the page is changed, is not in the offing?

Best,
Rob

On Tue, Sep 23, 2014 at 11:01 AM, Liko, Todd < <EMAIL REMOVED> > wrote:

> Hi all.
>
> Very good read on this subject. I understand the idea behind making a
> website more usable/more convenient.
>
> For me, it is about expected behavior and choosing how I want to navigate
> the website, whether do so by keyboard or using a mouse. When visiting a
> site, I am not expecting the focus to be somewhere within the page. I do
> not want someone making the decision for me where I should start tabbing.
>
> One example is when I am completing a form requesting a phone number. It
> is split into three fields. Sometimes, I must tab to the next field,
> sometime the focus automatically moves to the next field upon completion of
> the previous field. Some people like the convenience, I do not.
>
> Todd.
>
> -----Original Message-----
> From: <EMAIL REMOVED> [mailto:
> <EMAIL REMOVED> ] On Behalf Of Michael Bullis,
> Executive Director, The IMAGE Center of Maryland
> Sent: Tuesday, September 23, 2014 9:25 AM
> To: 'WebAIM Discussion List'
> Subject: Re: [WebAIM] Initial focus on search field?
>
> As a user and not a developer, I too think it's a usability issue. If the
> way you want visual people to use the site is by starting them at the
> searchbox, then do it for nonvisual users as well. Google, back in earlier
> iterations, use to set the focus to the searchbox automatically. I found
> it very helpful, since that's where I wanted to go mostly.
>
>
> -----Original Message-----
> From: <EMAIL REMOVED>
> [mailto: <EMAIL REMOVED> ] On Behalf Of Tim Harshbarger
> Sent: Tuesday, September 23, 2014 9:00 AM
> To: WebAIM Discussion List
> Subject: Re: [WebAIM] Initial focus on search field?
>
> 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
>
>
> -----Original Message-----
> From: <EMAIL REMOVED>
> [mailto: <EMAIL REMOVED> ] On Behalf Of Robert Fentress
> Sent: Monday, September 22, 2014 2:35 PM
> To: WebAIM Discussion List
> Subject: [WebAIM] Initial focus on search field?
>
> Hello, all.
>
> Do you have a sense for what is best practice concerning where focus
> should initially be set on pages in complex web sites that contain a
> prominent global search field on every page?
>
> For our site, the search field appears after an initial set of navigation
> links, and at this point, changing the order of the menu links and the
> search field in the code isn't feasible. An original design constraint was
> that the search field be automatically given focus upon page load, since
> usability studies showed that most people preferred using search to
> navigate the site.
>
> However, I was concerned that this could present problems for screen
> reader users who might not notice the list of links before the search
> field. This does seem to be a common pattern on the web though, so I
> wonder if screen reader users would expect (and perhaps prefer) this
> behavior.
>
> Initially though, I recommended against explicitly setting focus.
> Instead, I suggested best practice would be to add, at the start of the
> page, a single skip link to the main content, and to create landmark
> regions for the main page areas (including role="search" for the where the
> search field appears). Screen reader users could then use landmark
> navigation to quickly get to the search field.
>
> The developer has gotten pushback though, because of the original design
> requirement mandating that focus be set to the initial search field. He
> has tried to be creative by not initially setting focus, instead making it
> so that, as soon as the user begins typing, focus is set to the search
> field.
> So a tab takes the user to the first link in the menu on the page, but
> typing "a search string" automatically moves the user to the search field
> and enters the text typed into the field.
> This is problematic, though, because some keys are reserved as page
> navigation commands by some screen readers, such that typing "b" takes you
> to the first button on the page, etc.
>
> At this point, given the constraints we're operating under, I'm leaning
> towards just telling him to set focus to the search field, with the thought
> that screen reader users may expect this sort of thing and figure things
> out, especially given the landmarks provided.
> What do you think?
>
> Thanks,
> Rob
>
> --
> Robert Fentress
> Senior Accessibility Solutions Designer
> 540.231.1255
>
> Technology-enhanced Learning & Online Strategies Assistive Technologies
> 1180 Torgersen Hall
> 620 Drillfield Drive (0434)
> Blacksburg, Virginia 24061
> > > messages to <EMAIL REMOVED>
> > > messages to <EMAIL REMOVED>
>
> > > messages to <EMAIL REMOVED>
>
> > > >



--
Robert Fentress
Senior Accessibility Solutions Designer
540.231.1255

Technology-enhanced Learning & Online Strategies
Assistive Technologies
1180 Torgersen Hall
620 Drillfield Drive (0434)
Blacksburg, Virginia 24061