Skip to content

Commit

Permalink
(core) Removing conditional styles for blank rows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
berhalak committed Apr 21, 2022
1 parent 77ef9df commit bedb19f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/client/widgets/FieldBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit bedb19f

Please sign in to comment.