Skip to content

Commit 565031a

Browse files
fix: undo deletes the newly insertedblock
1 parent f648b46 commit 565031a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/actions/enter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ export class EnterAction {
126126
*/
127127
private insertFromFlyout(workspace: WorkspaceSvg) {
128128
workspace.setResizesEnabled(false);
129-
Events.setGroup(true);
129+
const existingGroup = Events.getGroup();
130+
if (!existingGroup) {
131+
Events.setGroup(true);
132+
}
130133

131134
const stationaryNode = this.navigation.getStationaryNode(workspace);
132135
const newBlock = this.createNewBlock(workspace);
@@ -138,7 +141,6 @@ export class EnterAction {
138141
this.positionNewTopLevelBlock(workspace, newBlock);
139142
}
140143

141-
Events.setGroup(false);
142144
workspace.setResizesEnabled(true);
143145

144146
this.navigation.focusWorkspace(workspace);

0 commit comments

Comments
 (0)