Skip to content

Commit 046d35d

Browse files
committed
Fix: When using a scrolling table and there was a x-scroll offset when entering the floating mode, the x-scroll wouldn't be applied.
https://datatables.net/forums/discussion/81476
1 parent 20a943d commit 046d35d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/dataTables.fixedHeader.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ $.extend(FixedHeader.prototype, {
439439
itemDom.floating.append(itemElement);
440440

441441
this._widths(itemDom);
442+
443+
return scrollLeftUpdate;
442444
}
443445
},
444446

@@ -581,7 +583,7 @@ $.extend(FixedHeader.prototype, {
581583
else if (mode === 'in') {
582584
// Remove the header from the real table and insert into a fixed
583585
// positioned floating table clone
584-
this._clone(item, forceChange);
586+
let scrollLeftUpdate = this._clone(item, forceChange);
585587

586588
// Get useful position values
587589
var scrollOffset = scrollBody.offset();
@@ -625,6 +627,7 @@ $.extend(FixedHeader.prototype, {
625627
});
626628

627629
importantWidth(position.width);
630+
scrollLeftUpdate();
628631

629632
if (item === 'footer') {
630633
itemDom.floating.css('top', '');

0 commit comments

Comments
 (0)