mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +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:
parent
56624c4a95
commit
2a3328abfc
@ -299,6 +299,7 @@ GridView.gridCommands = {
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.cursor.setCursorPos(saved);
|
this.cursor.setCursorPos(saved);
|
||||||
this.cursor.setLive(true);
|
this.cursor.setLive(true);
|
||||||
|
this.clearSelection();
|
||||||
})
|
})
|
||||||
.catch(reportError);
|
.catch(reportError);
|
||||||
},
|
},
|
||||||
@ -719,7 +720,7 @@ GridView.prototype.deleteColumns = function(selection) {
|
|||||||
let actions = fields.filter(col => !col.disableModify()).map(col => ['RemoveColumn', col.colId()]);
|
let actions = fields.filter(col => !col.disableModify()).map(col => ['RemoveColumn', col.colId()]);
|
||||||
if (actions.length > 0) {
|
if (actions.length > 0) {
|
||||||
this.tableModel.sendTableActions(actions, `Removed columns ${actions.map(a => a[1]).join(', ')} ` +
|
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());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1519,6 +1519,11 @@ export function openRowMenu(rowNum: number) {
|
|||||||
.then(() => driver.findWait('.grist-floating-menu', 1000));
|
.then(() => driver.findWait('.grist-floating-menu', 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function removeRow(rowNum: number) {
|
||||||
|
await (await openRowMenu(rowNum)).findContent('li', /Delete/).click();
|
||||||
|
await waitForServer();
|
||||||
|
}
|
||||||
|
|
||||||
export async function openCardMenu(rowNum: number) {
|
export async function openCardMenu(rowNum: number) {
|
||||||
const section = await driver.find('.active_section');
|
const section = await driver.find('.active_section');
|
||||||
const firstRow = await section.findContent('.detail_row_num', String(rowNum));
|
const firstRow = await section.findContent('.detail_row_num', String(rowNum));
|
||||||
|
Loading…
Reference in New Issue
Block a user