From 59f160609b5eb843cf8222e44e747515b843533f Mon Sep 17 00:00:00 2001 From: JSC Date: Sat, 9 Aug 2025 21:53:17 +0200 Subject: [PATCH] Disables body scroll when in fullscreen mode Prevents the body from scrolling when the player is in fullscreen mode, enhancing the user experience. Re-enables body scroll when exiting fullscreen. --- src/components/player/Player.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/player/Player.tsx b/src/components/player/Player.tsx index 08d018a..7542ee6 100644 --- a/src/components/player/Player.tsx +++ b/src/components/player/Player.tsx @@ -79,6 +79,22 @@ export function Player({ className }: PlayerProps) { } }, []) + // Handle body scroll when in fullscreen + useEffect(() => { + if (displayMode === 'maximized') { + // Disable body scroll + document.body.style.overflow = 'hidden' + } else { + // Re-enable body scroll + document.body.style.overflow = 'unset' + } + + // Cleanup when component unmounts + return () => { + document.body.style.overflow = 'unset' + } + }, [displayMode]) + const executeAction = useCallback(async (action: () => Promise, actionName: string) => { setIsLoading(true) try {