WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Having an application element gain focus when the page loads?

for

From: Brandon Keith Biggs
Date: Mar 12, 2018 11:07AM


Hello,
The app is similar to a game, where all the keyboard input needs to be
passed to the element.

<div role="application">
<input type="button" autofocus="true"/>
</div>

seems to work really well.
Is there an advantage to using tabindex rather than autofocus?
Thanks,


Brandon Keith Biggs <http://brandonkeithbiggs.com/>;

On Mon, Mar 12, 2018 at 9:44 AM, Jonathan Avila < <EMAIL REMOVED> >
wrote:

> > Or does the page also contain other things that are outside of the
> application area, but you'd want THAT to be accessed first?
>
> I would strongly advise against using the role application on a body
> element. The application role should only be reserved for specific widgets
> where no other role fits and keys need to be passed through from the screen
> reader to the content. Use of application mode is often misused and limits
> the user's access and in my opinion often is a flag for an application that
> was designed by people who do not understand who users who are blind or
> visually impaired use screen readers, quick navigation keys, and other
> features.
>
> There may be some specific situations where it is appropriate for the body
> element but it would be extremely limited.
>
> Jonathan
>
> Jonathan Avila
> Chief Accessibility Officer
> Level Access
> <EMAIL REMOVED>
> 703.637.8957 office
>
> Visit us online:
> Website | Twitter | Facebook | LinkedIn | Blog
>
> See you at CSUN in March!
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On
> Behalf Of Patrick H. Lauke
> Sent: Monday, March 12, 2018 12:24 PM
> To: <EMAIL REMOVED>
> Subject: Re: [WebAIM] Having an application element gain focus when the
> page loads?
>
> On 12/03/2018 09:30, Brandon Keith Biggs wrote:
> > Hello,
> > I have a page with:
> > <div role="application"></div>
> >
> > I'm trying to figure out how to properly have it gain focus when the
> > page loads (for both sighted and blind users), and pass all keyboard
> > input to an element.
>
> Assuming the whole page is an application, why not add role="application"
> directly to the <body> ? Or does the page also contain other things that
> are outside of the application area, but you'd want THAT to be accessed
> first?
>
> P
> --
> Patrick H. Lauke
>
> www.splintered.co.uk | https://github.com/patrickhlauke
> http://flickr.com/photos/redux/ | http://redux.deviantart.com
> twitter: @patrick_h_lauke | skype: patrick_h_lauke
> > > at http://webaim.org/discussion/archives
> > > > > >