(core) Fixing click-away bug for the cell color widget

Summary:
After introducing multi columns operation, color picker
could save a cell style for a wrong column, if the save operation
was triggered by user clicking on one of the cells.

Test Plan: Updated

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3668
This commit is contained in:
Jarosław Sadziński
2022-10-24 12:06:24 +02:00
parent 82eb5b3f76
commit 7c8db90aef
6 changed files with 205 additions and 126 deletions

View File

@@ -199,7 +199,10 @@ export class RightPanel extends Disposable {
}));
owner.autoDispose(selectedColumns.subscribe(cols => {
this._gristDoc.viewModel.activeSection()?.selectedFields(cols || []);
if (owner.isDisposed() || this._gristDoc.isDisposed() || this._gristDoc.viewModel.isDisposed()) { return; }
const section = this._gristDoc.viewModel.activeSection();
if (!section || section.isDisposed()) { return; }
section.selectedFields(cols || []);
}));
this._gristDoc.viewModel.activeSection()?.selectedFields(selectedColumns.peek() || []);