mirror of
https://github.com/codex-team/editor.js
synced 2026-03-17 16:10:07 +01:00
fix: Cross block selection gets wrong when pointer leaves the window 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
07d2fc0db4
1 changed files with 3 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue