Selection is available only for the main mouse button (#629)

* update table

* Fix mouse button
This commit is contained in:
horoyami 2019-02-28 20:04:56 +03:00 committed by GitHub
parent 75dbc91f53
commit 6cd011140c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

6
dist/editor.js vendored

File diff suppressed because one or more lines are too long

View file

@ -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

View file

@ -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",

View file

@ -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
*/
@ -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);