From baee6209fc5092b47b431b977004138de2c617ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Thu, 5 Feb 2026 21:26:01 +0100 Subject: [PATCH] pl-fe: another partial fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/modals/media-modal.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/pl-fe/src/modals/media-modal.tsx b/packages/pl-fe/src/modals/media-modal.tsx index e014f4dea..44d28ddc5 100644 --- a/packages/pl-fe/src/modals/media-modal.tsx +++ b/packages/pl-fe/src/modals/media-modal.tsx @@ -127,12 +127,22 @@ const MediaModal: React.FC = (props) => { }; const bind = useDrag( - ({ active, movement: [mx], direction: [xDir], cancel }) => { + ({ active, movement: [mx], direction: [xDir], cancel, event }) => { // Disable swipe when zoomed in. if (zoomedIn) { return; } + // Disable swipe when interacting with video/audio controls or other interactive elements + const target = event?.target as HTMLElement | null; + if (target) { + const interactiveParent = target.closest('.video-player__controls'); + if (interactiveParent) { + cancel(); + return; + } + } + // If dragging and swipe distance is enough, change the index. if ( active &&