From 73a8c3ff95c8edbfd4f8327307e082a843dbc60c Mon Sep 17 00:00:00 2001 From: Jost Schulte Date: Tue, 6 Apr 2021 00:06:11 +0200 Subject: [PATCH] Fix pip sliding down on click (#5147) * Fix pip sliding down on click * Add top margin to PiP intial position Co-authored-by: Jost Schulte --- ts/components/CallingPip.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/components/CallingPip.tsx b/ts/components/CallingPip.tsx index c6a6f1e71..e8b54e0b2 100644 --- a/ts/components/CallingPip.tsx +++ b/ts/components/CallingPip.tsx @@ -86,7 +86,7 @@ export const CallingPip = ({ const [windowHeight, setWindowHeight] = React.useState(window.innerHeight); const [positionState, setPositionState] = React.useState({ mode: PositionMode.SnapToRight, - offsetY: 0, + offsetY: PIP_TOP_MARGIN, }); React.useEffect(() => { @@ -202,7 +202,7 @@ export const CallingPip = ({ return [ PIP_PADDING, Math.min( - PIP_TOP_MARGIN + positionState.offsetY, + positionState.offsetY, windowHeight - PIP_PADDING - PIP_HEIGHT ), ]; @@ -210,7 +210,7 @@ export const CallingPip = ({ return [ windowWidth - PIP_PADDING - PIP_WIDTH, Math.min( - PIP_TOP_MARGIN + positionState.offsetY, + positionState.offsetY, windowHeight - PIP_PADDING - PIP_HEIGHT ), ];