From e5057a2ac3dd117721b6e02df6f1b561b0d8e1f8 Mon Sep 17 00:00:00 2001 From: westtle <103447524+westtle@users.noreply.github.com> Date: Tue, 13 Feb 2024 22:11:46 +0700 Subject: [PATCH] aria-hidden and tabindex -1 in .settings to be loaded in javascript this way people can still tab and use a screen reader when both css and js are disabled. i don't know who or why you would even want to do that, but oh well. --- assets/scripts/settings.js | 8 +++++++- index.html | 12 ++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/assets/scripts/settings.js b/assets/scripts/settings.js index 64fbf03..4c4ff44 100644 --- a/assets/scripts/settings.js +++ b/assets/scripts/settings.js @@ -25,4 +25,10 @@ function toggleSettings() { }; }; -settingsToggle.addEventListener("click", toggleSettings); \ No newline at end of file +settingsToggle.addEventListener("click", toggleSettings); + +document.addEventListener("DOMContentLoaded", () => { + // No tabbing and hide from screen reader until it is open. + settingsList.setAttribute("aria-hidden", true); + settingsItems.forEach(item => {item.tabIndex = -1}); +}); \ No newline at end of file diff --git a/index.html b/index.html index 54613f3..5994565 100644 --- a/index.html +++ b/index.html @@ -64,9 +64,9 @@ Press to open settings. -