Skip to content

Commit ff4f12f

Browse files
author
“Bastien
committed
Fix evaluateSingleRuleOnDict() function in order to avoid always returning the first evaluation result
1 parent 39bf389 commit ff4f12f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/chart/table/TableChart.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ export const NeoTableChart = (props: ChartProps) => {
245245
ColumnSortedDescendingIcon: () => <></>,
246246
ColumnSortedAscendingIcon: () => <></>,
247247
},
248-
// TODO: if mixing and matching row and cell styling, row rules MUST be set first or will not populate correctly
249248
getRowClassName: (params) => {
250249
return ['row color', 'row text color']
251250
.map((e) => {

src/extensions/styling/StyleRuleEvaluator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ export const evaluateRulesOnDict = (dict, rules, customizations) => {
6363
}
6464
for (const [index, rule] of rules.entries()) {
6565
// Only check customizations that are specified
66-
return evaluateSingleRuleOnDict(dict, rule, index, customizations);
66+
const evaluationResult = evaluateSingleRuleOnDict(dict, rule, index, customizations);
67+
if (evaluationResult !== -1) {
68+
return evaluationResult;
69+
}
6770
}
6871
// If no rules are met, return not found (index=-1)
6972
return -1;

0 commit comments

Comments
 (0)