From 948eb0d0fc15f5d0cc135ea727e4f8d9293a0cc2 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Fri, 6 Mar 2026 22:13:38 +0100 Subject: [PATCH] fix: close sidebar when tapping outside on mobile Add a semi-transparent backdrop overlay (lg:hidden) behind the sidebar on mobile. Clicking/tapping the backdrop closes the sidebar. Co-Authored-By: Claude Opus 4.6 --- src/lib/components/Layout/Sidebar.svelte | 12 +++++++++++- src/routes/+layout.svelte | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/components/Layout/Sidebar.svelte b/src/lib/components/Layout/Sidebar.svelte index f8b0ddb..978feb0 100644 --- a/src/lib/components/Layout/Sidebar.svelte +++ b/src/lib/components/Layout/Sidebar.svelte @@ -5,9 +5,10 @@ interface Props { open: boolean; + onClose?: () => void; } - let { open }: Props = $props(); + let { open, onClose }: Props = $props(); function setFilter(filter: NoteFilter) { selectedTag.set(null); @@ -20,6 +21,15 @@ } +{#if open} + +
{ if (e.key === 'Escape') onClose?.(); }} + >
+{/if} +