preventDefault() and stopPropagation() only if moving

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-05-03 15:07:25 +02:00
parent 7042eb38dd
commit adcdd72a08
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -199,11 +199,11 @@ export default class CallPreview extends React.Component<IProps, IState> {
}
private onMoving = (event: React.MouseEvent | MouseEvent) => {
if (!this.state.moving) return;
event.preventDefault();
event.stopPropagation();
if (!this.state.moving) return;
this.lastX = event.pageX - this.initX;
this.lastY = event.pageY - this.initY;