Skip to content

🎥 Make videos programmatically with React

Elements: Anchor split-screen panels within the managed root

Jonny Burgera94e8fe5a1e1
diff --git a/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx b/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx
index 427bc267c2..3bf4c06647 100644
--- a/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx
+++ b/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx
@@ -31,8 +31,10 @@ const SlideToSplitScreenInner: React.FC = () => {
<div
style={{
height,
+ left: 0,
overflow: 'hidden',
position: 'absolute',
+ top: 0,
width: interpolate(splitProgress, [0, 1], [width, aPanelWidth]),
}}
>
@@ -75,6 +77,7 @@ const SlideToSplitScreenInner: React.FC = () => {
height,
position: 'absolute',
right: 0,
+ top: 0,
translate: `${(1 - splitProgress) * (bPanelWidth + DIVIDER_WIDTH)}px 0px`,
width: bPanelWidth + DIVIDER_WIDTH,
willChange: 'transform',