(core) When a checkbox is clicked on a new record, set default values determined by linking

Summary: Fixes a bug (reported in https://community.getgrist.com/t/bug-toggle-column-in-linking-widget-not-triggering-default-value/1657)

Test Plan: Added a test case that fails without this fix.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3699
This commit is contained in:
Dmitry S
2022-11-10 12:59:24 -05:00
parent 46148aa125
commit 5c67e12aa5
9 changed files with 185 additions and 98 deletions

View File

@@ -54,9 +54,9 @@ export class Cursor extends Disposable {
// Command to be manually triggered on cell selection. Moves the cursor to the selected cell.
// This is overridden by the formula editor to insert "$col" variables when clicking cells.
setCursor(this: Cursor, rowModel: BaseRowModel, colModel: BaseRowModel) {
setCursor(this: Cursor, rowModel: BaseRowModel, fieldModel: BaseRowModel) {
this.rowIndex(rowModel ? rowModel._index() : 0);
this.fieldIndex(colModel ? colModel._index()! : 0);
this.fieldIndex(fieldModel ? fieldModel._index()! : 0);
},
};