From 956c2a051a6b08277586b42eefadae22b6611dc6 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 27 Jan 2026 21:41:02 +0100 Subject: [PATCH] Fix the sidebar resizer accessibility It's width was a bit wrong because of its box-sizing property and it was causing some issues when resizing it with the keyboard. And for the thumbnails sidebar, the tabindex was missing and some aria properties too. --- web/sidebar.css | 1 + web/sidebar.js | 12 +++++------- web/viewer.html | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/web/sidebar.css b/web/sidebar.css index 225940482..2a29beb63 100644 --- a/web/sidebar.css +++ b/web/sidebar.css @@ -48,6 +48,7 @@ min-width: var(--sidebar-min-width); max-width: var(--sidebar-max-width); backdrop-filter: var(--sidebar-backdrop-filter); + box-sizing: border-box; .sidebarResizer { width: var(--resizer-width); diff --git a/web/sidebar.js b/web/sidebar.js index e4f0b874a..e4e560630 100644 --- a/web/sidebar.js +++ b/web/sidebar.js @@ -64,12 +64,10 @@ class Sidebar { this.#initialWidth = this.#width = parseFloat( style.getPropertyValue("--sidebar-width") ); - resizer.ariaValueMin = parseFloat( - style.getPropertyValue("--sidebar-min-width") - ); - resizer.ariaValueMax = parseFloat( - style.getPropertyValue("--sidebar-max-width") - ); + resizer.ariaValueMin = + parseFloat(style.getPropertyValue("--sidebar-min-width")) || 0; + resizer.ariaValueMax = + parseFloat(style.getPropertyValue("--sidebar-max-width")) || Infinity; resizer.ariaValueNow = this.#width; this.#makeSidebarResizable(); @@ -123,7 +121,7 @@ class Sidebar { window.addEventListener( "pointermove", ev => { - if (!pointerMoveAC) { + if (!pointerMoveAC || Math.abs(ev.clientX - this.#prevX) < 1) { return; } stopEvent(ev); diff --git a/web/viewer.html b/web/viewer.html index 3cd2ffd10..d0abe5e17 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -278,7 +278,7 @@ See https://github.com/adobe-type-tools/cmap-resources -
+