Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/blockly/core/shortcut_items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export function registerCut() {
if (focused instanceof BlockSvg) {
focused.checkAndDelete();
} else if (isIDeletable(focused)) {
eventUtils.setGroup(true);
focused.dispose();
eventUtils.setGroup(false);
}
return !!copyData;
},
Expand Down
5 changes: 5 additions & 0 deletions packages/blockly/tests/mocha/shortcut_items_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ suite('Keyboard Shortcut Items', function () {
this.disposeSpy = sinon.spy(this.comment, 'dispose');

this.injectionDiv.dispatchEvent(keyEvent);

const deleteEvents = this.workspace
.getUndoStack()
.filter((e) => e.type === 'comment_delete');
assert(deleteEvents[0].group !== ''); // Group string is not empty
sinon.assert.calledOnce(this.copySpy);
sinon.assert.calledOnce(this.disposeSpy);
});
Expand Down