From cb4f6c2ccb8055f624e25f6e1af5752fb0b84dab Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Thu, 28 Mar 2024 18:17:03 +0200 Subject: [PATCH] UHF-9762: Add tabindex=-1 and toc-focusable class for all elements that are used as anchors on table of contents --- modules/helfi_toc/assets/js/tableOfContents.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/helfi_toc/assets/js/tableOfContents.js b/modules/helfi_toc/assets/js/tableOfContents.js index 5e3e03070..12d6cef61 100644 --- a/modules/helfi_toc/assets/js/tableOfContents.js +++ b/modules/helfi_toc/assets/js/tableOfContents.js @@ -181,6 +181,8 @@ } // Create anchor links. content.setAttribute('id', anchorName); + content.setAttribute('tabindex', '-1'); // Set tabindex to -1 to avoid issues with screen readers. + content.setAttribute('class', 'toc-focusable'); }); if (tableOfContents) {