From 2e80fbd11ee9e8ed1d8bc292499b0d893484b5e9 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Fri, 19 Dec 2025 23:49:44 -0500 Subject: [PATCH] center tap close --- src/app.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app.tsx b/src/app.tsx index afd4516..4be9ca8 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -157,6 +157,24 @@ function AppLayout(props: { children: any }) { }); }); + const handleCenterTap = (e: MouseEvent) => { + const isMobile = window.innerWidth < 768; + + // Only hide left bar on mobile when it's visible + if (isMobile && leftBarVisible()) { + // Check if the click is on an interactive element + const target = e.target as HTMLElement; + const isInteractive = target.closest( + "a, button, input, select, textarea, [onclick]" + ); + + // Don't hide if clicking on interactive elements + if (!isInteractive) { + setLeftBarVisible(false); + } + } + }; + return ( <>
@@ -167,6 +185,7 @@ function AppLayout(props: { children: any }) { width: `${centerWidth()}px`, "margin-left": `${leftBarSize()}px` }} + onClick={handleCenterTap} > }> }>{props.children}