diff --git a/packages/ketcher-core/src/application/editor/tools/Clear.ts b/packages/ketcher-core/src/application/editor/tools/Clear.ts index ce2270da39..eef1a7b2bb 100644 --- a/packages/ketcher-core/src/application/editor/tools/Clear.ts +++ b/packages/ketcher-core/src/application/editor/tools/Clear.ts @@ -16,6 +16,7 @@ import { CoreEditor, EditorHistory } from 'application/editor/internal'; import { SequenceMode } from 'application/editor/modes'; import { BaseTool } from 'application/editor/tools/Tool'; +import { ReinitializeSequenceModeCommand } from 'application/editor/operations/modes'; class ClearTool implements BaseTool { private history: EditorHistory; @@ -24,12 +25,13 @@ class ClearTool implements BaseTool { this.editor = editor; this.history = new EditorHistory(editor); + const modelChanges = this.editor.drawingEntitiesManager.deleteAllEntities(); + this.editor.renderersContainer.update(modelChanges); + if (editor.mode instanceof SequenceMode) { - return; + modelChanges.addOperation(new ReinitializeSequenceModeCommand()); } - const modelChanges = this.editor.drawingEntitiesManager.deleteAllEntities(); - this.editor.renderersContainer.update(modelChanges); this.history.update(modelChanges); }