From 70e205165bdcad4cf50259f59ff8a4723516ab12 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Fri, 23 Feb 2024 16:51:13 +0100 Subject: [PATCH] Merge pull request #37036 from software-mansion-labs/video-player-followups/app-returns-to-previous-thread-when-pressed-on-video Fix app returns to previous thread when scrubbing video in thread (cherry picked from commit c71387c6dc3d2baf052d02701db650cebc397d86) --- src/components/VideoPlayer/BaseVideoPlayer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/VideoPlayer/BaseVideoPlayer.js b/src/components/VideoPlayer/BaseVideoPlayer.js index df79c7ef18da..5f63703b462f 100644 --- a/src/components/VideoPlayer/BaseVideoPlayer.js +++ b/src/components/VideoPlayer/BaseVideoPlayer.js @@ -168,7 +168,12 @@ function BaseVideoPlayer({ }, [bindFunctions, currentVideoPlayerRef, currentlyPlayingURL, isSmallScreenWidth, originalParent, sharedElement, shouldUseSharedVideoElement, url]); return ( - <> + // We need to wrap the video component in a component that will catch unhandled pointer events. Otherwise, these + // events will bubble up the tree, and it will cause unexpected press behavior. + {(isHovered) => ( @@ -247,7 +252,7 @@ function BaseVideoPlayer({ hidePopover={hidePopoverMenu} anchorPosition={popoverAnchorPosition} /> - + ); }