Skip to content

Commit 5bb8a1a

Browse files
committed
Fix: Prevent mobile focus loop
1 parent 75903eb commit 5bb8a1a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

js/dataTables.fixedHeader.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,11 @@ $.extend(FixedHeader.prototype, {
519519
: null;
520520
var scrollBody = $($(this.s.dt.table().node()).parent());
521521

522-
if (mode === 'in-place') {
522+
if (mode === this.s[item + 'Mode']) {
523+
// Skip if already the current mode
524+
return;
525+
}
526+
else if (mode === 'in-place') {
523527
// Insert the header back into the table's real header
524528
if (itemDom.placeholder) {
525529
itemDom.placeholder.remove();
@@ -528,8 +532,7 @@ $.extend(FixedHeader.prototype, {
528532

529533
if (item === 'header') {
530534
itemDom.host.prepend(tablePart);
531-
}
532-
else {
535+
} else {
533536
itemDom.host.append(tablePart);
534537
}
535538

0 commit comments

Comments
 (0)