mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 22:06:49 +02:00
Fix unstable block cut process (#1485)
* Fix unstable block cut process * Update CHANGELOG Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
This commit is contained in:
parent
21adb61bc9
commit
143a539e01
|
@ -7,6 +7,7 @@
|
|||
- `Improvements` - Remove bundles from the repo [#1541](https://github.com/codex-team/editor.js/pull/1541).
|
||||
- `Improvements` - Document will be scrolled when blocks are selected with `SHIFT+UP` or `SHIFT+DOWN` [#1447](https://github.com/codex-team/editor.js/issues/1447)
|
||||
- `Fix` - Fix BlockManager.setCurrentBlockByChildNode() with multiple Editor.js instances [#1503](https://github.com/codex-team/editor.js/issues/1503).
|
||||
- `Fix` - Fix an unstable block cut process [#1489](https://github.com/codex-team/editor.js/issues/1489).
|
||||
- `Fix` - Type definition of the Sanitizer config: the sanitize function now contains param definition [#1491](https://github.com/codex-team/editor.js/pull/1491).
|
||||
|
||||
### 2.19.1
|
||||
|
|
|
@ -167,7 +167,7 @@ export default class BlockEvents extends Module {
|
|||
*
|
||||
* @param {ClipboardEvent} event - clipboard event
|
||||
*/
|
||||
public handleCommandC(event: ClipboardEvent): void {
|
||||
public handleCommandC(event: ClipboardEvent): Promise<void> {
|
||||
const { BlockSelection } = this.Editor;
|
||||
|
||||
if (!BlockSelection.anyBlockSelected) {
|
||||
|
@ -175,7 +175,7 @@ export default class BlockEvents extends Module {
|
|||
}
|
||||
|
||||
// Copy Selected Blocks
|
||||
BlockSelection.copySelectedBlocks(event);
|
||||
return BlockSelection.copySelectedBlocks(event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -183,14 +183,14 @@ export default class BlockEvents extends Module {
|
|||
*
|
||||
* @param {ClipboardEvent} event - clipboard event
|
||||
*/
|
||||
public handleCommandX(event: ClipboardEvent): void {
|
||||
public async handleCommandX(event: ClipboardEvent): Promise<void> {
|
||||
const { BlockSelection, BlockManager, Caret } = this.Editor;
|
||||
|
||||
if (!BlockSelection.anyBlockSelected) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockSelection.copySelectedBlocks(event);
|
||||
await BlockSelection.copySelectedBlocks(event);
|
||||
|
||||
const selectionPositionIndex = BlockManager.removeSelectedBlocks();
|
||||
|
||||
|
|
Loading…
Reference in a new issue