Skip to content

Commit e4fd3fc

Browse files
authored
fix: event propagation issue (#178)
* fix: ensure modals close before immich-web event listeners fire * temp: event stuff * chore: remove comment
1 parent b9a7bce commit e4fd3fc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib/components/Modal/Modal.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
<Dialog.Portal>
6666
<Dialog.Overlay class="absolute start-0 top-0 flex h-dvh w-screen bg-black/30" />
6767
<Dialog.Content
68+
onkeydown={(e) => {
69+
if (e.key === 'Escape' && open) {
70+
// Stop propagation to ensure modals close before immich-web takes over
71+
e.stopPropagation();
72+
open = false;
73+
onClose?.();
74+
}
75+
}}
6876
class={cleanClass(
6977
'absolute start-0 top-0 flex h-dvh w-screen items-center justify-center overflow-hidden sm:p-4',
7078
)}

0 commit comments

Comments
 (0)