From c22492147b8b5904ceb205b87d0852ffcf4c8d24 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 10 Sep 2024 23:18:08 +0100 Subject: [PATCH] remove scrollbar-gutter in fullscreen (#5258) --- .../post-embeds/VideoEmbedInner/VideoWebControls.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx index a12d04db66..e9005a37e7 100644 --- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx +++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx @@ -95,6 +95,15 @@ export function Controls({ } }, [interactingViaKeypress]) + useEffect(() => { + if (isFullscreen) { + document.documentElement.style.scrollbarGutter = 'unset' + return () => { + document.documentElement.style.removeProperty('scrollbar-gutter') + } + } + }, [isFullscreen]) + // pause + unfocus when another video is active useEffect(() => { if (!active) {