Skip to content

Commit 0f43b7d

Browse files
committed
Fix: Bootstrap 5 was showing odd behaviour with scrolling - it was flickering the scroll position during the mode transistion.
This appears to be due to `scroll-behavior: smooth;` in Bootstrap 5. I've remove the "hold" position as the browsers all seem to paint the change sync now. I haven't been able to replicate the original issue that required that hold. https://datatables.net/forums/discussion/76463 https://datatables.net/forums/discussion/73759 DD-2576
1 parent 0572c2b commit 0f43b7d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

js/dataTables.fixedHeader.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,6 @@ $.extend( FixedHeader.prototype, {
307307
itemDom.floating.removeClass( 'fixedHeader-floating fixedHeader-locked' );
308308
}
309309
else {
310-
var docScrollLeft = $(document).scrollLeft();
311-
var docScrollTop = $(document).scrollTop();
312-
313310
if ( itemDom.floating ) {
314311
if(itemDom.placeholder !== null) {
315312
itemDom.placeholder.remove();
@@ -379,13 +376,6 @@ $.extend( FixedHeader.prototype, {
379376

380377
// Clone widths
381378
this._matchWidths( itemDom.placeholder, itemDom.floating );
382-
383-
// The above action will remove the table header, potentially causing the table to
384-
// collapse to a smaller size, before it is then re-inserted (append). The result
385-
// can be that the document, if scrolling, can "jump".
386-
$(document)
387-
.scrollTop(docScrollTop)
388-
.scrollLeft(docScrollLeft);
389379
}
390380
},
391381

0 commit comments

Comments
 (0)