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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 &&