mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 18:25:49 +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:
parent
53b8fd3072
commit
fca5347668
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue