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 <jost@jibble.io>
This commit is contained in:
parent
79c94dafd5
commit
73a8c3ff95
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ export const CallingPip = ({
|
||||||
const [windowHeight, setWindowHeight] = React.useState(window.innerHeight);
|
const [windowHeight, setWindowHeight] = React.useState(window.innerHeight);
|
||||||
const [positionState, setPositionState] = React.useState<PositionState>({
|
const [positionState, setPositionState] = React.useState<PositionState>({
|
||||||
mode: PositionMode.SnapToRight,
|
mode: PositionMode.SnapToRight,
|
||||||
offsetY: 0,
|
offsetY: PIP_TOP_MARGIN,
|
||||||
});
|
});
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
@ -202,7 +202,7 @@ export const CallingPip = ({
|
||||||
return [
|
return [
|
||||||
PIP_PADDING,
|
PIP_PADDING,
|
||||||
Math.min(
|
Math.min(
|
||||||
PIP_TOP_MARGIN + positionState.offsetY,
|
positionState.offsetY,
|
||||||
windowHeight - PIP_PADDING - PIP_HEIGHT
|
windowHeight - PIP_PADDING - PIP_HEIGHT
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -210,7 +210,7 @@ export const CallingPip = ({
|
||||||
return [
|
return [
|
||||||
windowWidth - PIP_PADDING - PIP_WIDTH,
|
windowWidth - PIP_PADDING - PIP_WIDTH,
|
||||||
Math.min(
|
Math.min(
|
||||||
PIP_TOP_MARGIN + positionState.offsetY,
|
positionState.offsetY,
|
||||||
windowHeight - PIP_PADDING - PIP_HEIGHT
|
windowHeight - PIP_PADDING - PIP_HEIGHT
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue