diff --git a/src/lib/components/ui/ExpandableImage.svelte b/src/lib/components/ui/ExpandableImage.svelte index abd8e7a0..104ecb8c 100644 --- a/src/lib/components/ui/ExpandableImage.svelte +++ b/src/lib/components/ui/ExpandableImage.svelte @@ -14,6 +14,7 @@ import { Icon, XMark } from 'svelte-hero-icons' import { backOut, expoOut } from 'svelte/easing' import { fade, scale } from 'svelte/transition' + import { focusTrap } from 'svelte-focus-trap' /** * The full-resolution image URL @@ -31,6 +32,10 @@ flex flex-col z-[200] overscroll-contain" transition:fade={{ duration: 150 }} on:click={() => history.back()} + on:keydown={(e) => { + if (e.key == 'Escape') history.back() + }} + use:focusTrap >