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/AbilityCardZoom.svelte | 8 ++++++++ web/src/lib/ui/decks/ModifierCardZoom.svelte | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'web/src/lib/ui/decks') diff --git a/web/src/lib/ui/decks/AbilityCardZoom.svelte b/web/src/lib/ui/decks/AbilityCardZoom.svelte index dc5e258..35cad25 100644 --- a/web/src/lib/ui/decks/AbilityCardZoom.svelte +++ b/web/src/lib/ui/decks/AbilityCardZoom.svelte @@ -36,13 +36,21 @@ return Math.max(zoom, 0.5); } 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}