[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 <specc.dev@gmail.com>
This commit is contained in:
Tanya 2022-05-14 00:20:42 +08:00 committed by GitHub
parent 8fec2e71c3
commit c1d7744b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

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

View file

@ -167,7 +167,6 @@ export default class Toolbar extends Module<ToolbarNodes> {
opened: this.toolboxInstance.opened,
close: (): void => {
this.toolboxInstance.close();
this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock);
},
open: (): void => {
/**

View file

@ -544,6 +544,7 @@ export default class UI extends Module<UINodes> {
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) {