mirror of
https://github.com/codex-team/editor.js
synced 2024-06-09 09:22:16 +02:00
[Bug] Cross block selection selected state gets wrong when pointer moves out edit area
The mouse events doesnt work when the mouse get outs of the editor window. Related to issue #2167
This commit is contained in:
parent
b619946e8f
commit
5b04f2be68
|
@ -185,14 +185,14 @@ export default class RectangleSelection extends Module {
|
|||
this.processMouseDown(mouseEvent);
|
||||
}, false);
|
||||
|
||||
this.listeners.on(document.body, 'mousemove', _.throttle((mouseEvent: MouseEvent) => {
|
||||
this.listeners.on(window, 'mousemove', _.throttle((mouseEvent: MouseEvent) => {
|
||||
this.processMouseMove(mouseEvent);
|
||||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
||||
}, 10), {
|
||||
passive: true,
|
||||
});
|
||||
|
||||
this.listeners.on(document.body, 'mouseleave', () => {
|
||||
this.listeners.on(window, 'mouseleave', () => {
|
||||
this.processMouseLeave();
|
||||
});
|
||||
|
||||
|
@ -203,7 +203,7 @@ export default class RectangleSelection extends Module {
|
|||
passive: true,
|
||||
});
|
||||
|
||||
this.listeners.on(document.body, 'mouseup', () => {
|
||||
this.listeners.on(window, 'mouseup', () => {
|
||||
this.processMouseUp();
|
||||
}, false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue