Make drupal.tableheader only use CSS for sticky table headers

Created on 9 April 2024, 8 months ago
Updated 18 June 2024, 6 months ago

Problem/Motivation

The `drupal.tableheader` library provided a way to make table header sticky using JS when IE11 didn't have support for `position:sticky`.
Now that Drupal doesn't support IE11, we can remove the JS workaround and use `position:sticky` instead.

Related issues:

Steps to reproduce

Proposed resolution

  1. โœ… Remove tableheader.js
  2. โœ… Add `sticky-header` class to tables if `#sticky` is `true` for the table.
  3. โœ… Add CSS to set `position:sticky` for `.sticky-header thead`
  4. โœ… Update `drupal.tableheader` to include this css
  5. โœ… Add/update tests

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

Sticky table headers are now implemented with pure CSS instead of JavaScript.

Claro's custom implementation of sticky table headers which was already using pure CSS, has been removed and now relies on the default implementation.

Themes that heavily customise the sticky tableheaders markup, CSS, or JavaScript may need to update, or may be able to remove overrides if they were implementing a CSS-only solution similar to Claro's.

๐Ÿ“Œ Task
Status

Fixed

Version

10.3 โœจ

Component
Javascriptย  โ†’

Last updated 1 day ago

  • Maintained by
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @justafish
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance @nod_
Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia dipakmdhrm

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024