Skip to content

Commit

Permalink
fix(web): keyboard event propagation in modals (#9713)
Browse files Browse the repository at this point in the history
* fix: key events propagating from modal, visible close button focus

* feat: set initial focus on the text field for album creation

* chore: step back duplicated changes
  • Loading branch information
ben-basten authored May 26, 2024
1 parent 4d4bb8b commit 9628ea2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions web/src/lib/components/shared-components/full-screen-modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@
}
</script>

<FocusTrap>
<section
role="presentation"
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"
>
<section
role="presentation"
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"
on:keydown={(event) => {
event.stopPropagation();
}}
>
<FocusTrap>
<div
class="z-[9999] max-w-[95vw] max-h-[95vh] {modalWidth} overflow-y-auto rounded-3xl bg-immich-bg shadow-md dark:bg-immich-dark-gray dark:text-immich-dark-fg immich-scrollbar"
style="max-height: min(95vh, 900px);"
Expand All @@ -72,5 +75,5 @@
</div>
{/if}
</div>
</section>
</FocusTrap>
</FocusTrap>
</section>

0 comments on commit 9628ea2

Please sign in to comment.