mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Clearing selection after rows or cols were removed
Summary: The selection was not cleared after removing rows, and it still kept deleted rows ids. Removing selected rows once again produced an assertion error. Also, the selection is now cleared when columns are removed. Test Plan: Updated tests Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3623
This commit is contained in:
@@ -299,6 +299,7 @@ GridView.gridCommands = {
|
||||
.finally(() => {
|
||||
this.cursor.setCursorPos(saved);
|
||||
this.cursor.setLive(true);
|
||||
this.clearSelection();
|
||||
})
|
||||
.catch(reportError);
|
||||
},
|
||||
@@ -719,7 +720,7 @@ GridView.prototype.deleteColumns = function(selection) {
|
||||
let actions = fields.filter(col => !col.disableModify()).map(col => ['RemoveColumn', col.colId()]);
|
||||
if (actions.length > 0) {
|
||||
this.tableModel.sendTableActions(actions, `Removed columns ${actions.map(a => a[1]).join(', ')} ` +
|
||||
`from ${this.tableModel.tableData.tableId}.`);
|
||||
`from ${this.tableModel.tableData.tableId}.`).then(() => this.clearSelection());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user