diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index a0fc8a72..0d1cc839 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -254,26 +254,17 @@ class MultilineTextEditor extends Events { close(update: boolean): void { if (this.isVisible() && this._topic) { - if (!$defined(update) || update) { - const actionDispatcher = ActionDispatcher.getInstance(); - // Workaround. For some reason, close is triggered but the topic has been removed. Temporally, try to validate if exits. - try { - actionDispatcher - .getCommandContext() - .findTopics([this._topic.getId()]); - this._updateModel(); - - // Let make the visible text in the node ... - this._topic.getTextShape().setVisibility(true); - } catch (e) { - console.log(e); - } - // Remove it form the screen ... - this._containerElem.remove(); - this._containerElem = null; - } - this._topic = null; + const actionDispatcher = ActionDispatcher.getInstance(); + this._updateModel(); } + // Let make the visible text in the node ... + this._topic.getTextShape().setVisibility(true); + + // Remove it form the screen ... + this._containerElem.remove(); + this._containerElem = null; + this._topic = null; } } +} export default MultilineTextEditor;