Sticky headers in view with grouped results

Created on 13 September 2024, 15 days ago
Updated 21 September 2024, 7 days ago

Problem/Motivation

When using "sticky headers" in a view where rows are groupped by one of the fields, title of first group is being replaced by duplicated header of the table.
In result I can see headers twice, but header of the first group is gone, as seen on the screenshot:

Steps to reproduce

  1. Enable Gin admin theme
  2. Create new view with some fields, displayed as a table
  3. In Format: Settings select any field as Grouping field Nr.1
  4. In the same form enable "Drupal style sticky table headers"
  5. Observe dupliacted table headers, hiding name of the first group

Tested on Drupal 10.3.5 with Gin 8.x-3.0-rc13

🐛 Bug report
Status

Needs review

Component

Code

Created by

🇵🇱Poland besek

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

Merge Requests

Comments & Activities

  • Issue created by @besek
  • Status changed to Needs review 7 days ago
  • I have fixed this kindly used the attached patched and its working for both content and content view

  • 🇮🇳India milanchourasia

    I have reviewed and applied above patch.
    Patch No. : 3474245-1

    Its working fine on both places :

    1. Content
    2. ContentView

    I have also attached screenshot for better reference.

  • 🇵🇱Poland besek

    The patch from #3 works fine. Thanks @amitnar. Would you create MR?

  • Merge request !504Update 2 files → (Open) created by amitnar
  • Pipeline finished with Success
    5 days ago
    Total: 181s
    #290309
  • 🇮🇳India arunkumark Coimbatore

    As per comment #7, MR is created.
    Moving to Needs Review.

  • Hi

    Reviewed this issue, works fine after applying MR.
    Gin theme version 8.x-3.0-rc13
    Drupal version 11.0.5-dev

    Steps taken

    1. Enable Gin admin theme
    2. Create new view with some fields, displayed as a table
    3. In Format: Settings select any field as Grouping field Nr.1
    4. In the same form enable "Drupal style sticky table headers"
    5. Observe dupliacted table headers, hiding name of the first group.

    This issue can be moved ahead.
    RTBC +

  • 🇬🇷Greece iro

    The should only be one visible header at any time.
    At the given screenshots it is clear that this is not the case.

  • 🇵🇱Poland besek

    @iro, thanks for checking!

    The reason why there are two headers is caused by the fact that we are using "group by column" option and default Drupal behavior is to add separate header to every group created this way. Please see how it looks on Claro: claro_views_groupped_table.png

    However, sticky header on Claro works bit better, because it is moving only within one table and when it reaches the top of the screen, second header becomes sticky - all of them are working only within own table. While in Gin, the header that becomes sticky is always the first header from the first table and it travels through all of the page, creating an effect of duplicated headers from time to time. The other implication is that if tables has different width of the columns, this first header that became sticky is not aligned with the columns on nect tables.

    So, in my opinion, the original bug here has been fixed (as sticky header is not covering group headers anymore), however there is still issue with how sticky headers are working in Gin. But it would probably require separate issue? I'm happy to report separate issue on this, unless anybody feels different?

Production build 0.71.5 2024