Sticky headers stops tracking and changing visibility once a part of the page is updated with AJAX and Drupal.attachBehaviours is called.
This happend cause once Drupal.attachBehaviours is called then all previous data in "headers" variable (@see Drupal.behaviors.tableHeader) is erased. The data in "headers" variable presents array of already created sticky-header elements.
A proposed solution is very simple - prepopulate "headers" variable with already created sticky-header elements:
--- a/drupal/misc/tableheader.js
+++ b/drupal/misc/tableheader.js
@@ -15,6 +15,8 @@ Drupal.behaviors.tableHeader = function (context) {
// Keep track of all cloned table headers.
var headers = [];
+ $(".sticky-header").each(function(i, el){headers.push(el);});
+
$('table.sticky-enabled thead:not(.tableHeader-processed)', context).each(function () {
// Clone thead so it inherits original jQuery properties.
var headerClone = $(this).clone(true).insertBefore(this.parentNode).wrap('<table class="sticky-header"></table>').parent().css({
Comments
Comment #1
pwolanin commentedDoes this bug still happen in Drupal 7.x or 8.x? If so, it needs to be fixed there first.
Why are you marking this as "to be ported"?