Hi,
On release 9.0.0, when user deselects a cell, if there is an active editor, the close methods are called twice. Could this be an issue since some stuff could be cleaned up twice.
When user deselects the cell, the hook afterDeselect
is called.
this.selection.addLocalHook('afterDeselect', () => {
editorManager.destroyEditor(); // **The editor is destroyed for the first time.**
this._refreshBorders();
removeClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
this.runHooks('afterDeselect');
});
Inside of the _refreshBorders
, the editor is destroyed again.
this._refreshBorders = function () {
var revertOriginal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var prepareEditorIfNeeded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
editorManager.destroyEditor(revertOriginal); // **the editor is destroyed again.**
instance.view.render();
if (prepareEditorIfNeeded && selection.isSelected()) {
editorManager.prepareEditor();
}
};
Here is the fiddle: https://jsfiddle.net/guobacai/46gcnaLz/1/
Reproduce Step:
- Double click the column A. The editor should be enabled.
- Click any cell other than the active editor cell. Two alerts are displayed.