Olivero: Z-index issue with table with the sticky header.

Can be seen on the live preview. https://tugboat-aqrmztryfqsezpvnghut1cszck2wwasr.tugboat.qa/table

Adding screen-recording for reference.

Issue fork drupal-3212707

Command icon 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:

Comments

Gauravmahlawat created an issue. See original summary.

sakthivel m’s picture

Status: Active » Needs review
StatusFileSize
new839 bytes

#2 Please review the patch

gauravvvv’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.28 MB

Patch #2, increases the nesting for the sticky header class and fixes the issue. Adding after patch screen recording.

Moving to RTBC.

Thank you for working.

mherchel’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the work on this.

In my opinion, the sticky table header needs to be placed below the Olivero fixed menu (when it is present). There is a Drupal.displace API that may be able to help with this: https://www.drupal.org/node/1956804

sagarchauhan’s picture

StatusFileSize
new3.82 KB
new3.59 MB

Added patch following recommendations from @mherchel. Also attached the screencast for the new behavior.

sagarchauhan’s picture

Status: Needs work » Needs review
abhijith s’s picture

StatusFileSize
new7.13 MB

Applied patch #5 and its working fine.The overlapping of sticky table header is gone after applying this patch.

Screenshot after patch:
after

RTBC +1

chetanbharambe’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new6.47 MB

Verified and tested patch #5.
Patch applied successfully and looks good to me.

Testing Steps:
# Goto: Appearance -> Apply Olivero Theme
# Check the table format on /admin/content
# See the Z-index issue

Expected Results:
# After applying patch #5, The overlapping of the sticky table header is gone.

Please refer attached video for the same.
Looks good to me.
Can be a move to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll, +Needs tests

The patch needs a reroll plus I think we can add an automated test for this and use \Drupal\FunctionalJavascriptTests\JSWebAssert::assertVisibleInViewport() to make sure that sticky headers are working in Olivero.

yogeshmpawar’s picture

Issue tags: -Needs reroll
StatusFileSize
new3.75 KB

Re-roll of the patch against 9.3.x & keep this issue in Needs Work for tests.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andy-blum’s picture

Issue tags: +Needs reroll
gauravvvv’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.88 KB

Re-rolled patch #10 for 10.1.x. please review

tanuj.’s picture

Status: Needs review » Needs work
StatusFileSize
new852 KB

Tested patch #15 with Drupal 10.1.x and it broke the site layout.
Attaching gif for after applying patch #15.

Please refer to attached gif for the same.
Changing status to needs work.

pradipmodh13’s picture

StatusFileSize
new6.32 MB
new3.59 MB

Applied patch #15 but after applying layout was borken.
For ref attached two recording.

Vinayak.Ambig’s picture

Status: Needs work » Needs review
StatusFileSize
new29.29 MB

Applied Patch cleanly. But table header sticky is not working.

andy-blum’s picture

Status: Needs review » Needs work

@Vinayak.Ambig Thanks for the review, and welcome to the community! While the video would normally be helpful as a patch review, there are already two comments reviewing patch #15 asserting that the site layout is broken. Please take a look at the Drupal Issue Etiquette.

Since this patch has already been reviewed, we want this issue to remain as "needs work".

ameymudras’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB
new1.24 KB

inset-block-start causes the issue, I have posted a patch which fixes the issue but I will try to come up with a better solution for this issue

andy-blum’s picture

Status: Needs review » Needs work

A few issues with #20:

custom commands failure - be sure to run yarn lint:core-js-passing to make sure the JS file will pass the linting tests.


Let's avoid overwriting the entire style attribute by using the element's style property:

      if (pinnedState === true) {
        siteHeaderFixable.setAttribute('data-offset-top', '');
        siteHeaderFixable.setAttribute('style','inset-block-start: auto;');
      }
      else {
        siteHeaderFixable.removeAttribute('data-offset-top');
      }
siteHeaderFixable.style.insetBlockStart = 'auto';

Instead of attaching the sticky tableheader JS to the Olivero global library, we should do a library-override. See the olivero.info.yml and olivero.libraries.yml files and look to the drupal.message library to see an example of this.

Abhisheksingh27’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB
new625 bytes

Tried to fix custom commands failure of #20 patch

tanuj.’s picture

Status: Needs review » Needs work

Tested #22 and it doesn't fix the suggestions made in #21, changing the status to needs work again.

ameymudras’s picture

Status: Needs work » Needs review
StatusFileSize
new1.91 KB
new582 bytes
new1.91 KB

@Andy-blum thanks for the suggestions, I've changed the style attribute usage as per your suggestion. Im not sure why we need library-override because we are not extending / overriding any external library and the js/navigation-utils.js: {} that does the toogle function is a part of the global styling. Let me know your thoughts

andy-blum’s picture

@ameymudras

Im not sure why we need library-override because we are not extending / overriding any external library and the js/navigation-utils.js: {}

We are not currently doing this, but we have a hidden dependency there. For example in the code below:

  function adjustStickyTableHeader() {
    Drupal.TableHeader.tables.forEach(function (table) {
      table.recalculateSticky();
    });
  }

The Drupal.TableHeader object is coming from core/misc/tableheader.js, which is only present when the core/drupal.tableheader library is attached. Olivero does not declare any dependencies on this library, so there's the possibility that Olivero attaches javascript that will break when core JS has not been also been attached.

We do a similar thing with the core/drupal.message library, which is why I pointed to it as an example.

In olivero.info.yml we have

libraries-extend:
  core/drupal.message:
    - olivero/drupal.message

This tells Drupal that when Olivero is the theme, and the core/drupal.message library is attached, we need to also attach the olivero/drupal.message library.

Then, in olivero.libraries.yml we have

drupal.message:
  version: VERSION
  js:
    js/message.theme.js: {}
  dependencies:
    - olivero/messages

Saying that when we attach olivero.drupal.message, we need to send some additional JS as well as pull in the olivero/messages library.

For this issue, we need to add a library-extend entry for core/drupal.tableheader, and then a new library that serves the files Olivero needs to make this fix work.

smustgrave’s picture

Status: Needs review » Needs work

Moving to NW for #25 points.

Also was tagged for tests which still appear to be needed.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

This came up as a daily BSI target.

Think this definitely needs an issue summary to show what's being solved.

catch’s picture

Issue tags: +Needs manual testing

#3439580: Make drupal.tableheader only use CSS for sticky table headers changed the core implementation here quite a lot, so this probably needs to be manually tested again too.

I also opened #3515093: Olivero table.css should be in its own library and #attached to tables which is sort of related.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Title: Olivero: Z-index issue with table with sticky header » Z-index issue with table with sticky header

The Olivero theme was approved for removal in #3590816: [policy, no patch] Deprecate Olivero and move to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3595082: [meta] Tasks to deprecate the Olivero theme and the removal work in #3595085: [meta] Tasks to remove the Olivero theme.

quietone’s picture

Status: Needs work » Postponed
quietone’s picture

Project: Drupal core » Olivero
Version: main » 2.x-dev
Component: Olivero theme » Code
Status: Postponed » Needs work