Ensure playback rate controls are portaled to the video container in history view

On larger tablets in landscape view, the playback rate dropdown disappeared underneath the bottom bar. This small change ensures we use the correct container on the DropdownMenuContent so that the div is portaled correctly. The VideoControls are also used in motion review which does not pass in a container ref, so we can just fall back to the existing controlsContainer ref when it's undefined.
This commit is contained in:
Josh Hawkins 2025-06-04 20:39:14 -05:00
parent ee368cca9c
commit f4996ab4a5

View File

@ -250,7 +250,9 @@ export default function VideoControls({
>
<DropdownMenuTrigger>{`${playbackRate}x`}</DropdownMenuTrigger>
<DropdownMenuContent
portalProps={{ container: controlsContainerRef.current }}
portalProps={{
container: containerRef?.current ?? controlsContainerRef.current,
}}
>
<DropdownMenuRadioGroup
onValueChange={(rate) => onSetPlaybackRate(parseFloat(rate))}