Skip to content

Commit

Permalink
f177bf68c48474da299b8339e672e3035aed45a0 Fix: A <table> inside the …
Browse files Browse the repository at this point in the history
…first row of the `<tbody>` of the DataTable could cause issues when used with scrolling

The selector wasn't tight enough and would pick up the child table.

Sync to source repo @f177bf68c48474da299b8339e672e3035aed45a0
  • Loading branch information
dtbuild committed May 2, 2024
1 parent 605656c commit daac122
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.0.5",
"last-sync": "c5082522d26409699bb6f505e2f2f6bb544de125"
"last-sync": "f177bf68c48474da299b8339e672e3035aed45a0"
}
2 changes: 1 addition & 1 deletion js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -5079,7 +5079,7 @@
// of the indexes out.
if (settings.aiDisplay.length) {
// Get the column sizes from the first row in the table
var colSizes = table.find('tbody tr').eq(0).find('th, td').map(function (vis) {
var colSizes = table.children('tbody > tr').eq(0).children('th, td').map(function (vis) {
return {
idx: _fnVisibleToColumnIndex(settings, vis),
width: $(this).outerWidth()
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5026,7 +5026,7 @@ function _fnScrollDraw ( settings )
// of the indexes out.
if (settings.aiDisplay.length) {
// Get the column sizes from the first row in the table
var colSizes = table.find('tbody tr').eq(0).find('th, td').map(function (vis) {
var colSizes = table.children('tbody > tr').eq(0).children('th, td').map(function (vis) {
return {
idx: _fnVisibleToColumnIndex(settings, vis),
width: $(this).outerWidth()
Expand Down

0 comments on commit daac122

Please sign in to comment.