diff --git a/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_sidebar.js b/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_sidebar.js index a86ffe78..d7e829e8 100644 --- a/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_sidebar.js +++ b/fusion_plating/fusion_plating_portal/static/src/js/fp_portal_sidebar.js @@ -38,6 +38,17 @@ } }); }); + + // Resize safety: closing the drawer when the user crosses the desktop + // breakpoint prevents the backdrop's display:block from leaking onto + // the desktop layout. SCSS scopes the sidebar's drawer transform to + // @media (max-width: 768px), but the backdrop's display rule isn't + // media-scoped (intentionally — the JS owns that lifecycle). + window.addEventListener("resize", function () { + if (window.innerWidth > 768 && sidebar.classList.contains("o_fp_open")) { + toggleOpen(false); + } + }); } if (document.readyState === "loading") {