Skip to content

Commit 4edea7c

Browse files
author
Vinogradov Victor
committed
Fix mouse button
1 parent a3894f4 commit 4edea7c

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

dist/editor.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 2.11.1
4+
5+
- `Fix` *RectangeSelection* — Selection is available only for the main mouse button
6+
37
### 2.11.0
48

59
- `New` — Add API methods shorthands

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/editorjs",
3-
"version": "2.11.0",
3+
"version": "2.11.1",
44
"description": "Editor.js — Native JS, based on API and Open Source",
55
"main": "dist/editor.js",
66
"types": "./types/index.d.ts",

src/components/modules/rectangleSelection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ export default class RectangleSelection extends Module {
4949
private readonly BOTTOM_SCROLL_ZONE = 1;
5050
private readonly TOP_SCROLL_ZONE = 2;
5151

52+
/**
53+
* Id of main button for event.button
54+
*/
55+
private readonly MAIN_MOUSE_BUTTON = 0;
56+
5257
/**
5358
* Mouse is clamped
5459
*/
@@ -115,6 +120,7 @@ export default class RectangleSelection extends Module {
115120
});
116121

117122
Listeners.on(container, 'mousedown', (event: MouseEvent) => {
123+
if (event.button !== this.MAIN_MOUSE_BUTTON) { return; }
118124
this.startSelection(event.pageX, event.pageY);
119125
}, false);
120126

0 commit comments

Comments
 (0)