You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Add preventDefault() and stopPropagation()
This avoids text being selected while dragging Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -187,6 +187,9 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private onStartMoving = (event: React.MouseEvent) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
this.setState({moving: true});
|
||||
|
||||
this.initX = event.pageX - this.lastX;
|
||||
@@ -194,6 +197,9 @@ export default class CallPreview extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private onMoving = (event: React.MouseEvent | MouseEvent) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if (!this.state.moving) return;
|
||||
|
||||
this.lastX = event.pageX - this.initX;
|
||||
|
||||
Reference in New Issue
Block a user