GoogleChrome / accessibility-developer-tools

This is a library of accessibility-related testing and utility code.
Apache License 2.0
2.28k stars 363 forks source link

AXS dev tools audits can mess with focus. Can we restore it after the test? #276

Open ewinslow opened 8 years ago

ewinslow commented 8 years ago

I can clean up this issue trivially with code like so:

const focusedElement: any = document.activeElement;
// ... run audit ...
focusedElement.focus();

Seems like it'd be a nice good-faith effort to clean up after ADT like this by default.

seancurtis commented 8 years ago

This just bit me too. After running an audit, focus is left on the last focusable element in the page. Very frustrating to try to work around it.