Skip to content

Commit ab127f1

Browse files
authored
Fix: Auto focus next only when returning to body from disabled or hidden (fixes #486) (#487)
1 parent 6904446 commit ab127f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

js/a11y/browserFocus.js

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export default class BrowserFocus extends Backbone.Controller {
4545
if (event.target !== event.currentTarget) {
4646
return;
4747
}
48+
// Do not auto next if the focus isn't returning to the body
49+
if (!$(event.relatedTarget).is('body')) {
50+
return;
51+
}
4852
// Check if element losing focus is losing focus
4953
// due to the addition of a disabled class
5054
if (!$element.is('[disabled]') && $element.css('display') !== 'none' && $element.css('visibility') !== 'hidden') {

0 commit comments

Comments
 (0)