From c1d7744b8d5bcef2d69f4374d116ad4b36adc104 Mon Sep 17 00:00:00 2001 From: Tanya Date: Sat, 14 May 2022 00:20:42 +0800 Subject: [PATCH] [Fix] Stop jumping to block start on toolbox close (#2055) * Stop jumping to block start when on toolbox close * Update changelog and version * Set caret on esc press * Update package.json Co-authored-by: Peter Savchenko --- docs/CHANGELOG.md | 4 ++++ src/components/modules/toolbar/index.ts | 1 - src/components/modules/ui.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index be5ca188..27cf4ecb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 2.24.4 + +- `Fix` — Keyboard selection by word [2045](https://github.com/codex-team/editor.js/issues/2045) + ### 2.24.3 - `Fix` — Issue with toolbox preventing text selection fixed diff --git a/src/components/modules/toolbar/index.ts b/src/components/modules/toolbar/index.ts index 9f5a1db2..9a041766 100644 --- a/src/components/modules/toolbar/index.ts +++ b/src/components/modules/toolbar/index.ts @@ -167,7 +167,6 @@ export default class Toolbar extends Module { opened: this.toolboxInstance.opened, close: (): void => { this.toolboxInstance.close(); - this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock); }, open: (): void => { /** diff --git a/src/components/modules/ui.ts b/src/components/modules/ui.ts index 75bfef90..ead5c9ba 100644 --- a/src/components/modules/ui.ts +++ b/src/components/modules/ui.ts @@ -544,6 +544,7 @@ export default class UI extends Module { if (this.Editor.Toolbar.toolbox.opened) { this.Editor.Toolbar.toolbox.close(); + this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock); } else if (this.Editor.BlockSettings.opened) { this.Editor.BlockSettings.close(); } else if (this.Editor.ConversionToolbar.opened) {