1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-20 20:42:03 +03:00

Snap in PiP widget when content changed (#9797)

This commit is contained in:
Michael Weimann
2022-12-21 14:06:26 +01:00
committed by GitHub
parent 7db2ee749f
commit 1614674ca9
3 changed files with 112 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ export default class PictureInPictureDragger extends React.Component<IProps> {
UIStore.instance.off(UI_EVENTS.Resize, this.onResize);
}
public componentDidUpdate(prevProps: Readonly<IProps>): void {
if (prevProps.children !== this.props.children) this.snap(true);
}
private animationCallback = () => {
if (
!this.moving &&