From a98fba06cda1249eaaa3f7faff0d41c84fe37a19 Mon Sep 17 00:00:00 2001 From: spinline Date: Sat, 31 Jan 2026 00:49:07 +0300 Subject: [PATCH] fix: Lock body scroll when mobile sidebar is open --- frontend/src/app.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/src/app.rs b/frontend/src/app.rs index a93c38c..c3fb02c 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -45,6 +45,20 @@ pub fn App() -> impl IntoView { } }); + // Mobile Sidebar Scroll Lock + create_effect(move |_| { + if let Some(doc) = window().document() { + if let Some(body) = doc.body() { + let style = body.style(); + if show_mobile_sidebar.get() { + let _ = style.set_property("overflow", "hidden"); + } else { + let _ = style.remove_property("overflow"); + } + } + } + }); + // Context Menu Signals let (cm_visible, set_cm_visible) = create_signal(false); let (cm_pos, set_cm_pos) = create_signal((0, 0));