Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions js/widgets/widget-stickyHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@
.addClass( state )
.css(cssSettings);
}
if (isVisible !== laststate) {
// make sure the focused filter stay focused after showing/hiding sticky
var $td = $(document.activeElement).closest('td'),
column = $td.parent().children().index($td);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for contributing and I'm sorry for taking so long to follow up on this PR!

Would you please change this to get the cell's index from the data-column attribute since the header may have a colspan which would mess up this calculation.

if (column >= 0 && c.$filters) {
if (isVisible === "hidden") {
c.$filters.eq(column).find('a, select, input').focus();
} else {
$stickyTable.find('a, select, input').eq(column).focus();
}
}
}
if (isVisible !== laststate || resizing) {
// make sure the column widths match
resizeHeader();
Expand Down