table sticky-header goes under sticky navigation

Created on 21 February 2018, almost 7 years ago
Updated 29 August 2024, 3 months ago

When sticky navigation is enabled and the page contains a table with sticky-header, then when scrolling down the table's sticky header is no more visible because it is under the navigation div. This seems a normal behavior as core /misc/tableheader.js set a top:0px to the table's header. What we need is override the top:0px with top:{equal to navigation-div.height} when navigation becomes sticky.

I've seen some posts taking example on admin's toolbar (core modules/toolbar/toolbar.js) which sets Drupal.settings.tableHeaderOffset to Drupal.toolbar.height function then used by tableheader.js like this

  // Reset top position of sticky table headers to the current top offset.
  this.stickyOffsetTop = Drupal.settings.tableHeaderOffset ? eval(Drupal.settings.tableHeaderOffset + '()') : 0;
  this.stickyTable.css('top', this.stickyOffsetTop + 'px');

I didn't manage to make it work but anyway we need something similar in stickynav so the sticky-header of tables stops scrolling under the navigation div and not at the top of screen.

Feature request
Status

Needs review

Version

1.4

Component

Code

Created by

🇫🇷France erwangel

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024