mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fixing bug with hiding multiple columns
Summary: Selection in GridView wasn't updated when fields were removed, and the selected column index was out of bounds. Test Plan: New test added Reviewers: JakubSerafin Reviewed By: JakubSerafin Differential Revision: https://phab.getgrist.com/D4137
This commit is contained in:
@@ -39,6 +39,10 @@ export class CellSelector extends Disposable {
|
||||
super();
|
||||
this.autoDispose(this.view.cursor.rowIndex.subscribe(() => this.setToCursor()));
|
||||
this.autoDispose(this.view.cursor.fieldIndex.subscribe(() => this.setToCursor()));
|
||||
const fieldsLength = this.autoDispose(ko.pureComputed(() => this.view.viewSection.viewFields().all().length));
|
||||
this.autoDispose(fieldsLength.subscribe((length) => {
|
||||
this.col.end(Math.min(this.col.end.peek(), length - 1));
|
||||
}));
|
||||
this.setToCursor();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user