Skip to content

Commit

Permalink
fix: legacyAutosizeColumns should push hidden width as 0 (#977)
Browse files Browse the repository at this point in the history
- the previous code was skipping hidden columns, however we have a widths array that relies on column index and it became out of sync when a hidden column is skipped because the indexes no longer matches the column widths indexes when it is used in the next for loop
  • Loading branch information
ghiscoding authored Jan 16, 2024
1 parent f4184ef commit ab634eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3133,7 +3133,10 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e

for (i = 0; i < this.columns.length; i++) {
c = this.columns[i];
if (!c || c.hidden) { continue; }
if (!c || c.hidden) {
widths.push(0);
continue;
}
widths.push(c.width || 0);
total += c.width || 0;
if (c.resizable) {
Expand Down

0 comments on commit ab634eb

Please sign in to comment.