WebAIM - Web Accessibility In Mind

E-mail List Archives

Having an application element gain focus when the page loads?

for

From: Brandon Keith Biggs
Date: Mar 12, 2018 3:30AM


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.

Leaving the element empty does not show anything on the screen with my
screen reader.
Having:
<input type="text" autofocus="true"/>
works, but then I have to fight against the screen reader saying "blank"
when arrow keys are pressed.
Does anyone know how to properly focus an application when the page loads?
There are other elements on the page, so putting the body as an application
doesn't work.
Thanks,

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