Skip to content

Commit abebf8a

Browse files
authored
fix: misaligned column headers after horizontal scroll then freeze (#903)
- backported to version 4.x from PR #901
1 parent 4054996 commit abebf8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

slick.grid.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,6 +3155,12 @@ if (typeof Slick === "undefined") {
31553155
invalidateRow(getDataLength());
31563156
}
31573157

3158+
// before applying column freeze, we need our viewports to be scrolled back to left to avoid misaligned column headers
3159+
if (args.frozenColumn) {
3160+
getViewports().forEach(vp => vp.scrollLeft = 0);
3161+
handleScroll(); // trigger scroll to realign column headers as well
3162+
}
3163+
31583164
var originalOptions = utils.extend(true, {}, options);
31593165
options = utils.extend(options, args);
31603166
trigger(self.onSetOptions, { "optionsBefore": originalOptions, "optionsAfter": options });

0 commit comments

Comments
 (0)