From 697f1f0e3d1a62dee4c431bc6793c32d36c2afb7 Mon Sep 17 00:00:00 2001 From: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> Date: Wed, 8 Jul 2026 14:03:32 +0300 Subject: [PATCH] add aria-labels to icon-only buttons and inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Toolbar buttons (โ˜ฐ ๐Ÿ” โš™ โœ• โ”€ โค“ +) and the untitled doc-title/search inputs had no accessible name beyond a title tooltip, which screen readers don't reliably announce. --- index.html | 20 ++++++++++---------- src/main.ts | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index fd63307..10761fd 100644 --- a/index.html +++ b/index.html @@ -9,31 +9,31 @@
- - + + - - + +
- - + +
-
+
- + diff --git a/src/main.ts b/src/main.ts index 3dfe422..a11994a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -110,6 +110,7 @@ function renderDocList(): void { b.className = cls; b.textContent = text; b.title = title; + b.setAttribute("aria-label", title); b.addEventListener("click", (e) => { e.stopPropagation(); cb(); }); return b; }; @@ -241,7 +242,9 @@ function applySettings(): void { document.documentElement.style.setProperty("--editor-font-size", `${settings.fontSize}px`); $("#editor-wrap").style.setProperty("--results-width", `${settings.resultsWidth}%`); setLang(settings.language); - $("#search-input").placeholder = t("searchPlaceholder"); + const searchInput = $("#search-input"); + searchInput.placeholder = t("searchPlaceholder"); + searchInput.setAttribute("aria-label", t("searchPlaceholder")); engine.updateSettings({ precision: settings.precision, groupSeparator: settings.groupSeparator,