mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 22:06:49 +02:00
Fix shortcut execution on several Editor instances (#631)
* Fix shortcut execution on several Editor instances * fix problem before handling cmd+a
This commit is contained in:
parent
a16767eb12
commit
681e8a5827
|
@ -19,6 +19,7 @@ Welcome to testing stage. Please, join a [public Telegram-chat](//t.me/codex_edi
|
|||
|
||||
### 2.7-2.9 changelog
|
||||
|
||||
- `Fix` — Fix CMD+A Selection on multiple Editor instances
|
||||
- `New` — Toolbox now have beautiful helpers with Tool names and shortcuts
|
||||
- `Improvements` — Prevent navigating back on Firefox when Block is removing by backspace
|
||||
- `New` — Blocks selected with Rectangle Selection can be also removed, copied or cut
|
||||
|
|
8
dist/editor.js
vendored
8
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,13 @@
|
|||
# Changelog
|
||||
|
||||
### 2.11.3
|
||||
|
||||
- `Fix` — Fix CMD+A Selection on multiple Editor instances
|
||||
|
||||
### 2.11.2
|
||||
|
||||
- `Improvements` — Docs updated and common enhancements
|
||||
|
||||
### 2.11.1
|
||||
|
||||
- `Fix` *RectangeSelection* — Selection is available only for the main mouse button
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@editorjs/editorjs",
|
||||
"version": "2.11.2",
|
||||
"version": "2.11.3",
|
||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||
"main": "dist/editor.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
|
|
@ -107,6 +107,18 @@ export default class BlockSelection extends Module {
|
|||
Shortcuts.add({
|
||||
name: 'CMD+A',
|
||||
handler: (event) => {
|
||||
const {BlockManager} = this.Editor;
|
||||
/**
|
||||
* When one page consist of two or more EditorJS instances
|
||||
* Shortcut module tries to handle all events. Thats why Editor's selection works inside the target Editor, but for
|
||||
* others error occurs because nothing to select.
|
||||
*
|
||||
* Prevent such actions if focus is not inside the Editor
|
||||
*/
|
||||
if (!BlockManager.currentBlock) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.handleCommandA(event);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue