From 33faad1358ad056f0f5645705a9fe352a12dc462 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 23 Nov 2026 14:16:10 +0100 Subject: web: make card zoom overlays focusable The dialog-role overlays need a tabindex: use tabindex="-1" (out of the tab order, focusable programmatically) and focus the overlay when it opens, so the existing Escape handler actually works for keyboard users, not just mouse users. --- web/src/lib/ui/decks/ModifierCardZoom.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'web/src/lib/ui/decks/ModifierCardZoom.svelte') diff --git a/web/src/lib/ui/decks/ModifierCardZoom.svelte b/web/src/lib/ui/decks/ModifierCardZoom.svelte index 68cb150..98f32ea 100644 --- a/web/src/lib/ui/decks/ModifierCardZoom.svelte +++ b/web/src/lib/ui/decks/ModifierCardZoom.svelte @@ -28,13 +28,21 @@ return Math.min(DEFAULT_ZOOM, window.innerWidth / (CARD_WIDTH + 80)); } const scale = $state(scaleFor()); + + let zoomEl: HTMLDivElement | undefined = $state(); + $effect(() => { + // Focus the overlay when it opens so Escape (keyboard) can close it. + if (open) zoomEl?.focus(); + }); {#if open}