mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web, a11y): focus management for modals and popups (#8298)
* feat(web, a11y): focus management for modals and popups * feat: hide asset options dropdown on escape key
This commit is contained in:
parent
9fe80c25eb
commit
e1c2135850
12 changed files with 459 additions and 359 deletions
|
|
@ -1,16 +1,19 @@
|
|||
<script lang="ts">
|
||||
import { clickOutside } from '../../utils/click-outside';
|
||||
import { fade } from 'svelte/transition';
|
||||
import FocusTrap from '$lib/components/shared-components/focus-trap.svelte';
|
||||
|
||||
export let onClose: (() => void) | undefined = undefined;
|
||||
</script>
|
||||
|
||||
<section
|
||||
in:fade={{ duration: 100 }}
|
||||
out:fade={{ duration: 100 }}
|
||||
class="fixed left-0 top-0 z-[9990] flex h-screen w-screen place-content-center place-items-center bg-black/40"
|
||||
>
|
||||
<div class="z-[9999]" use:clickOutside={{ onOutclick: onClose, onEscape: onClose }}>
|
||||
<slot />
|
||||
</div>
|
||||
</section>
|
||||
<FocusTrap>
|
||||
<section
|
||||
in:fade={{ duration: 100 }}
|
||||
out:fade={{ duration: 100 }}
|
||||
class="fixed left-0 top-0 z-[9990] flex h-screen w-screen place-content-center place-items-center bg-black/40"
|
||||
>
|
||||
<div class="z-[9999]" use:clickOutside={{ onOutclick: onClose, onEscape: onClose }} tabindex="-1">
|
||||
<slot />
|
||||
</div>
|
||||
</section>
|
||||
</FocusTrap>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue