Sticky header does not keep events

Created on 22 March 2023, almost 2 years ago

Problem/Motivation

Sticky header does not keep events when is cloned https://git.drupalcode.org/project/gin/-/blob/8f287efb566102c27bc6e37553...

    createStickyHeader: function createStickyHeader(table) {
      const header = table.querySelector(':scope > thead');
      const stickyTable = document.createElement('table');
      stickyTable.className = 'sticky-header';
      stickyTable.append(header.cloneNode(true));
      table.insertBefore(stickyTable, header);
      this.handleResize(table);
    },

Javascript cloneNode does not keep the event listeners https://pawelgrzybek.com/cloning-dom-nodes-and-handling-attached-events/ and that makes that the VBO counter does not load the right counter when the "Select all" is checked on the sticky mode.

Steps to reproduce

Use Gin as the default admin theme.
Replace the Node bulk operations with the VBO.

Select all not sticky checkbox:

Select all sticky:

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024