From bedb19f9c77550cf079d86d3b5981195a8a68080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Wed, 20 Apr 2022 17:57:44 +0200 Subject: [PATCH] (core) Removing conditional styles for blank rows Summary: When grid view was not fully loaded the initial blank row was marked as invalid by conditional styles. This removes the styling when row is not fully loaded. Test Plan: Tested manually Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3392 --- app/client/widgets/FieldBuilder.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/client/widgets/FieldBuilder.ts b/app/client/widgets/FieldBuilder.ts index c5a8edf2..b2a50715 100644 --- a/app/client/widgets/FieldBuilder.ts +++ b/app/client/widgets/FieldBuilder.ts @@ -445,6 +445,9 @@ export class FieldBuilder extends Disposable { // and wait for the update. const computedRule = koUtil.withKoUtils(ko.pureComputed(() => { if (this.isDisposed()) { return null; } + // If this is add row or a blank row (not loaded yet with all fields = '') + // don't use rules. + if (row._isAddRow() || !row.id()) { return null; } const styles: Style[] = this.field.rulesStyles(); // Make sure that rules where computed. if (!Array.isArray(styles) || styles.length === 0) { return null; }