You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
normalize sizes when starting drag operation
This commit is contained in:
@@ -107,6 +107,7 @@ export class Resizer {
|
||||
}
|
||||
|
||||
const {sizer, distributor} = this._createSizerAndDistributor(resizeHandle);
|
||||
distributor.start();
|
||||
|
||||
const onMouseMove = (event) => {
|
||||
const offset = sizer.offsetFromEvent(event);
|
||||
@@ -118,9 +119,11 @@ export class Resizer {
|
||||
if (this.classNames.resizing) {
|
||||
this.container.classList.remove(this.classNames.resizing);
|
||||
}
|
||||
distributor.finish();
|
||||
body.removeEventListener("mouseup", onMouseUp, false);
|
||||
body.removeEventListener("mousemove", onMouseMove, false);
|
||||
};
|
||||
// TODO: listen for mouseout on document here as well
|
||||
body.addEventListener("mouseup", onMouseUp, false);
|
||||
body.addEventListener("mousemove", onMouseMove, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user