From 47e6d2b804ac2590157dfae97f36eea49b992cc6 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Sat, 7 Mar 2026 17:54:51 -0300 Subject: [PATCH] feat: Prevent body scroll on the editor page to enhance user experience --- frontend/src/index.css | 2 +- frontend/src/pages/EditorPage.tsx | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/index.css b/frontend/src/index.css index a00978a..cb1489d 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -22,5 +22,5 @@ body { #root { width: 100%; - height: 100vh; + min-height: 100vh; } diff --git a/frontend/src/pages/EditorPage.tsx b/frontend/src/pages/EditorPage.tsx index 9060305..398b025 100644 --- a/frontend/src/pages/EditorPage.tsx +++ b/frontend/src/pages/EditorPage.tsx @@ -69,6 +69,19 @@ export const EditorPage: React.FC = () => { return () => window.removeEventListener('keydown', handler); }, [handleSaveClick]); + // Prevent body scroll on the editor page + useEffect(() => { + const html = document.documentElement; + const body = document.body; + html.style.overflow = 'hidden'; + body.style.overflow = 'hidden'; + window.scrollTo(0, 0); + return () => { + html.style.overflow = ''; + body.style.overflow = ''; + }; + }, []); + const handleResizeMouseDown = useCallback((e: React.MouseEvent) => { e.preventDefault(); resizingRef.current = true;