WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: how to trash focus when sighted

for

From: Jonathan Avila
Date: Dec 17, 2019 6:10PM


I'd add on to Steve's comment that activeElement is limited to content not in an iframe. If the element is in an iframe activeElement will return the iFrame. You would need to use a more robust script in that case. For focus highlighting I'd also recommend the Stylus extension where you can create your own focus indicators or a tool like ANDI<https://www.ssa.gov/accessibility/andi/help/install.html> although neither will likely highlight items that rely on aria-activedescendant.



Jonathan



-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Steve Green
Sent: Tuesday, December 17, 2019 4:51 PM
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] how to trash focus when sighted



CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.





Create a bookmarklet with the following code:



javascript: console.log(document.activeElement);



When you want to know where focus is, trigger the bookmarklet. The JavaScript Console will show which element has focus.



There is also a bookmarklet called Force Show Focus, which you can get at http://pauljadam.com/bookmarklets.html. This forces a visible focus indicator onto elements.



Steve Green

Managing Director

Test Partners Ltd





-----Original Message-----

From: WebAIM-Forum < <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >> On Behalf Of Reinhard Stebner

Sent: 17 December 2019 20:51

To: <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >

Subject: [WebAIM] how to trash focus when sighted



I am working with a developer who is attempting to develop a custom select list box. Is there a tool to help track where programmatic focus when particular events are being fired? For example when enter or a arrow key is pressed? Thsi develoepr is sighted and is learning how to develop with aria and how to manage focus in custom JavaScript based applications.

or a