Skip to content

Commit

Permalink
Selection is available only for the main mouse button (codex-team#629)
Browse files Browse the repository at this point in the history
* update table

* Fix mouse button
  • Loading branch information
horoyami authored Feb 28, 2019
1 parent 75dbc91 commit 6cd0111
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dist/editor.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 2.11.1

- `Fix` *RectangeSelection* — Selection is available only for the main mouse button

### 2.11.0

- `New` — Add API methods shorthands
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/editorjs",
"version": "2.11.0",
"version": "2.11.1",
"description": "Editor.js — Native JS, based on API and Open Source",
"main": "dist/editor.js",
"types": "./types/index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions src/components/modules/rectangleSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export default class RectangleSelection extends Module {
private readonly BOTTOM_SCROLL_ZONE = 1;
private readonly TOP_SCROLL_ZONE = 2;

/**
* Id of main button for event.button
*/
private readonly MAIN_MOUSE_BUTTON = 0;

/**
* Mouse is clamped
*/
Expand Down Expand Up @@ -115,6 +120,7 @@ export default class RectangleSelection extends Module {
});

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

Expand Down

0 comments on commit 6cd0111

Please sign in to comment.