Skip to content

Commit 7f11eff

Browse files
authored
fix: misaligned column headers after horizontal scroll then freeze (#901)
1 parent 6c6714a commit 7f11eff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/slick.grid.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,6 +3468,12 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
34683468
this.invalidateRow(this.getDataLength());
34693469
}
34703470

3471+
// before applying column freeze, we need our viewports to be scrolled back to left to avoid misaligned column headers
3472+
if (args.frozenColumn) {
3473+
this.getViewports().forEach(vp => vp.scrollLeft = 0);
3474+
this.handleScroll(); // trigger scroll to realign column headers as well
3475+
}
3476+
34713477
const originalOptions = Utils.extend(true, {}, this._options);
34723478
this._options = Utils.extend(this._options, args);
34733479
this.trigger(this.onSetOptions, { optionsBefore: originalOptions, optionsAfter: this._options });

0 commit comments

Comments
 (0)