auto resize column update (#21426)

This commit is contained in:
Alan Ren
2022-12-15 15:16:12 -08:00
committed by GitHub
parent 3aab4fd115
commit a5e2e77042

View File

@@ -145,7 +145,8 @@ export class AutoColumnSize<T extends Slick.SlickData> implements Slick.Plugin<T
let autoSizeWidth = Math.max(headerWidth, this.getMaxColumnTextWidth(columnDef, colIndex)) + 1;
if (autoSizeWidth !== column.width) {
// Only resize if the current width is smaller than the new width.
if (autoSizeWidth > column.width) {
allColumns[colIndex].width = autoSizeWidth;
this._grid.setColumns(allColumns);
this._grid.onColumnsResized.notify();