Skip to content

Commit

Permalink
fix: Conditional formatting not being applied to custom columns (#1181)
Browse files Browse the repository at this point in the history
Fixes #1135 

Removed `getCachedModelColumns` and uses `model.columns` instead.
  • Loading branch information
emilyhuxng authored Mar 29, 2023
1 parent 778346c commit 1e4f8f9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/iris-grid/src/IrisGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1233,13 +1233,6 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
getFormatColumns(columns, rules)
);

// customColumns arg is needed to invalidate the cache
// eslint-disable-next-line no-unused-vars
getCachedModelColumns = memoize(
(model: IrisGridModel, customColumns: readonly ColumnName[]) =>
model.columns
);

/**
* Builds formatColumns array based on the provided formatting rules with optional preview
* @param columns Array of columns
Expand Down Expand Up @@ -4491,7 +4484,7 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
this.grid?.state.draggingColumn?.range
)}
formatColumns={this.getCachedPreviewFormatColumns(
this.getCachedModelColumns(model, customColumns),
model.columns,
conditionalFormats,
conditionalFormatPreview,
// Disable the preview format when we press Back on the format edit page
Expand Down

0 comments on commit 1e4f8f9

Please sign in to comment.