Problem/Motivation
If CSS variable --drupal-displace-offset-top is not defined, tableheader is not sticky anymore, because this one have no fallback value https://git.drupalcode.org/project/drupal/-/blob/11.x/core/themes/claro/...
Bug was catched here https://www.drupal.org/project/navigation/issues/3432222
Steps to reproduce
1. Standard profile installation
2. composer require drupal/navigation
3. drush en -y navigation
4. checkout in MR from here https://www.drupal.org/project/navigation/issues/3432222 (or if this task is already fixed - no need), just use navigation module as it is
5. generate several nodes so it's enough to get sticky table header on this page "/admin/content" (faster with devel generate, than manually)
6. scroll down on "/admin/content" -> no sticky table header
Proposed resolution
Replace
top: var(--drupal-displace-offset-top);
by
top: var(--drupal-displace-offset-top, 0px);
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3432298-drupal-displace-offset-top-css-variable-define-fallback-value.patch | 916 bytes | dylanmehl |
| #10 | 3432298-10.patch | 854 bytes | javitan |
Issue fork drupal-3432298
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3432298-sticky-table-header
changes, plain diff MR !7102
Comments
Comment #3
kostyashupenkoComment #4
smustgrave commentedWas wondering if we need a test but the change is so small doubt it would be worth it, if tests would even be possible.
Comment #9
nod_Committed f0dfe7d and pushed to 11.x. Thanks!
Comment #10
javitan commentedThe changes of the branch didn't work for me, so I overridden the CSS value to use
top: 0instead. This is working for Drupal 10.2.4.Comment #12
dylanmehl commentedThe code modification in commit f0dfe7d addresses the majority of our issues related to tables with sticky headers. I have attached a patch file to my comment for those who wish to apply the fix as a patch.
Update: I made a small mistake in my previous patch, I have fixed the issue, uploaded the new patch and hide the previous patch.
Comment #13
dylanmehl commentedComment #14
dylanmehl commented