Skip to content

Commit ef7aacb

Browse files
authored
refactor: Cherry-pick DH-20363: Expose paddingMap reset method on IrisGridMetricCalculator (#2619)
Expose a method allowing to reset private `cachedPaddingMaps` in subclasses. This method is needed for the Pivot plugin to reset header group widths when the filter bar is expanded or collapsed.
1 parent 06638d4 commit ef7aacb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/iris-grid/src/IrisGridMetricCalculator.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,19 @@ export class IrisGridMetricCalculator extends GridMetricCalculator {
232232
!deepEqual(headerGroupNames, this.cachedHeaderGroupNames)
233233
) {
234234
this.resetCalculatedColumnWidths();
235-
this.cachedPaddingMaps.clear();
236235
}
237236
this.cachedHeaderGroupNames = headerGroupNames;
238237
}
239238

239+
resetCalculatedHeaderGroupWidths(): void {
240+
this.cachedPaddingMaps.clear();
241+
}
242+
243+
resetCalculatedColumnWidths(): void {
244+
super.resetCalculatedColumnWidths();
245+
this.resetCalculatedHeaderGroupWidths();
246+
}
247+
240248
getGridY(state: IrisGridMetricState): number {
241249
// The state here seems to be a GridMetricState with stateOverrides passed from IrisGrid in the props,
242250
// not guaranteed to be IrisGridMetricState

0 commit comments

Comments
 (0)