diff --git a/resources/assets/javascripts/lib/skip_links.js b/resources/assets/javascripts/lib/skip_links.js index c37af9eeef07577f803bbb4c093632f24c6d0951..1a4a9d0c98d9a07769c7acb43e0733055346a9dd 100644 --- a/resources/assets/javascripts/lib/skip_links.js +++ b/resources/assets/javascripts/lib/skip_links.js @@ -79,9 +79,14 @@ const SkipLinks = { SkipLinks.moveSkipLinkNavigationOut(); jQuery('.focus_box').removeClass('focus_box'); jQuery(fragment).addClass('focus_box'); - jQuery(fragment) - .click() - .focus(); + if (jQuery(fragment).is(':focusable')) { + jQuery(fragment) + .click() + .focus(); + } else { + //Set the focus on the first focusable element: + jQuery(fragment).find(':focusable').eq(0).focus(); + } SkipLinks.activeElement = fragment; return true; } else {