aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/lib
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2022-01-25 16:17:01 +0000
committerMoritz Strohm <strohm@data-quest.de>2022-01-25 16:17:01 +0000
commit50871fb1c2ea40847b6ffeb451f10e67c8a2f1bc (patch)
treefdc113a00f4e814208975a6cf943738e8b95a3e6 /resources/assets/javascripts/lib
parent50202028eab9dea122fb1b8bd082b60f45c7152c (diff)
fix for BIESt #583
Diffstat (limited to 'resources/assets/javascripts/lib')
-rw-r--r--resources/assets/javascripts/lib/skip_links.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/resources/assets/javascripts/lib/skip_links.js b/resources/assets/javascripts/lib/skip_links.js
index c37af9e..1a4a9d0 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 {