Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky table header with enabled responsive table is broken since Drupal core 10.3 #431

Open
peterserfozo opened this issue Sep 12, 2024 · 1 comment

Comments

@peterserfozo
Copy link

peterserfozo commented Sep 12, 2024

  1. Create a view with sticky table headers: in my example, I changed the path of /views/view/content to /nodes so it will use the oe_bootstrap_theme instead of the admin theme.
  2. Add some nodes
  3. Make sure "Tables/Responsive" is set to "Always": /admin/appearance/settings/oe_bootstrap_theme
  4. Visit the page /nodes:
Screenshot 2024-09-12 at 15 23 40

If responsive tables are disabled, then the position of the table header is correct. But there is a visual glitch because the background of the table header is transparent:
Screenshot 2024-09-12 at 15 33 29

There are two different issues to fix:

  1. Position the table header correctly when sticky table header and responsive table are enabled
  2. Change the background of the table header from transparent to white(?) to fix the visual glitch

Resources:
https://www.drupal.org/project/drupal/releases/10.3.0
https://www.drupal.org/node/3440477
https://git.drupalcode.org/project/drupal/-/commit/4609482e7298ccfaeb93ada8188ddaa1deacd2f0

table-responsive makes the table container to be scrollable horizontally and it will become the nearest ancestor that has scrolling mechanism for the sticky header. According to the documentation, an element with position sticky will only stick to the nearest ancestor with the scrolling mechanism, in this case it would be the table container rather than the window as we wanted => sticky table header is not compatible with responsive tables

@msnassar
Copy link
Contributor

msnassar commented Sep 13, 2024

Here is the change record from core https://www.drupal.org/node/3440477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants