diff --git a/frontend/src/lib/components/layout/TaskDrawer.svelte b/frontend/src/lib/components/layout/TaskDrawer.svelte index ec0b243..776b5b6 100644 --- a/frontend/src/lib/components/layout/TaskDrawer.svelte +++ b/frontend/src/lib/components/layout/TaskDrawer.svelte @@ -64,9 +64,9 @@ window.location.href = "/reports"; } - // Handle overlay click - function handleOverlayClick(event) { - if (event.target === event.currentTarget) { + function handleGlobalKeydown(event) { + if (!isOpen) return; + if (event.key === "Escape") { handleClose(); } } @@ -192,25 +192,16 @@ }); - + + {#if isOpen} -
e.key === 'Escape' && handleClose()} - role="button" - tabindex="0" - aria-label={$t.tasks?.close_drawer || "Close drawer"} + role="dialog" + aria-modal="false" + aria-label={$t.tasks?.drawer || "Task drawer"} > - - + {/if}