(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
pull/203/head
Jarosław Sadziński 2 years ago
parent 77ef9df27d
commit bedb19f9c7

@ -445,6 +445,9 @@ export class FieldBuilder extends Disposable {
// and wait for the update.
const computedRule = koUtil.withKoUtils(ko.pureComputed<ComputedStyle>(() => {
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; }

Loading…
Cancel
Save