Fix drag issue that leaves editor open

This commit is contained in:
Paulo Gustavo Veiga 2022-02-18 08:11:33 -08:00
parent 0fe100222f
commit df6edba21b

View File

@ -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;