Title and screenshots should be self explanatory. A simple, 1 line fix would be adding a z-index to the sticky table header class. However, I'm not quite sure if this would affect other parts of the system negatively (resulting in fallout with other z-index problems).

Comments

kiphaas7’s picture

Status: Active » Needs review
StatusFileSize
new322 bytes

Doh, forgot the patch... Still needs testing, and if this might be fixed in some other way. Steps to reproduce the above use case: install date module, add date field, see the problem (tested both in firefox 3.6 and opera 11).

I didn find any funky styling for the input elements made by the date module:

.container-inline-date .form-item input, .container-inline-date .form-item select, .container-inline-date .form-item option {
    margin-right: 5px;
}

.container-inline-date .form-item, .container-inline-date .form-item input {
    width: auto;
}

Status: Needs review » Needs work

The last submitted patch, 1010080_1.patch, failed testing.

kiphaas7’s picture

Status: Needs work » Needs review
StatusFileSize
new314 bytes

patch without funky prefixes, still getting used to git.

james.elliott’s picture

Status: Needs review » Reviewed & tested by the community

This occurs because the date module wraps each section in a fieldset and the Seven theme adds position: relative; to the fieldsets. This means that anything inside a sticky enabled table with position: relative; is going to have a z-index issue with the table header. This patch is non-dangerous and fixes this potentially rampant z-indexing issue. RTBC.

kiphaas7’s picture

If that is true... Then the fix shouldn't be in the system.base.css, but in the according template css. Investigating.

kiphaas7’s picture

Component: system.module » Bartik theme
Status: Reviewed & tested by the community » Needs review
Issue tags: +Seven
StatusFileSize
new1.11 KB

Only Bartik and Seven exhibit this behavior, Stark and Garland do not have this problem. This is probably because (as james.elliott pointed out) only Bartik and Seven fieldsets use position: relative.

So, added the necessary css change in their own css files. Also added some comments explaining the z-index.

Jeff Burnz’s picture

Component: Bartik theme » system.module
Priority: Minor » Normal

Only Bartik and Seven exhibit this behavior...

Actually no, many themes and modules may add position relative to fieldsets or whatever else (some of my D7 themes do this also), so my thinking is this should go into system.base.css.

This is a fairly innocuous change (adding z-index to table.sticky-header), so my thinking is this could basically go strait into D7 and I would also support the patch in #3.

Leaving as needs review because it should have broader testing (I seriously doubt anything is going to break because of this but best to play it really safe at this stage).

kiphaas7’s picture

Issue tags: -Seven
StatusFileSize
new1.11 KB
new600 bytes

I'll leave it up to higher powers to decide what is the better approach.

I think it is the responsibility of the theme to fix positioning if they introduce a position: relative for fieldsets. On the other hand, position: relative for fieldsets is pretty common.

Attached are #3 (a) and #6 (b), #3 (a) now also has comments.

Status: Needs review » Needs work

The last submitted patch, 1010080_8b.patch, failed testing.

kiphaas7’s picture

Status: Needs work » Needs review

#8: 1010080_8b.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1010080_8b.patch, failed testing.

kiphaas7’s picture

Status: Needs work » Needs review

Rogue testbot? Last attempt...

kiphaas7’s picture

#8: 1010080_8b.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1010080_8b.patch, failed testing.

kiphaas7’s picture

Status: Needs work » Needs review
StatusFileSize
new1.11 KB
new600 bytes

rerolled, don know what went wrong...

Status: Needs review » Needs work

The last submitted patch, 1010080_15b.patch, failed testing.

mooffie’s picture

+1

The addition of "z-index" also fixes a problem in the Flag module, whose links are by default "position: relative" and thus overlap the sticky table header.

mooffie’s picture

(The comment in the CSS says "However, fieldsets using position: relative still overlap sticky headers." I suggest it be changed to "However, elements that use 'position: relative' (most notably fieldsets) still overlap sticky headers" because the problem isn't specific to fieldsets.)

kiphaas7’s picture

Good one! Will reroll & change as soon as I have some time. Or, if someone else has some time, they could reroll it ;).

kiphaas7’s picture

Status: Needs work » Needs review
StatusFileSize
new634 bytes

Just the 'a' version with comments improvements per #18.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

This is good to go :).
As a few people mentioned we have to fix this in core to overcome problems with position:relative with fieldsets in core and with other elements in contrib.

kiphaas7’s picture

#20: 1010080_20a.patch queued for re-testing.

rfay’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs review

D8 first. Let's get these fixed on D8 and into D7.

kiphaas7’s picture

Ok, but that does not changes the status, right?

rfay’s picture

I don't see how something can be RTBC for D8 if it hasn't been tested by the testbot and tried out there....

kiphaas7’s picture

Ok, so now it's a D8 issue, just re-testing the patch should show if the testbot is happy or not for D8, right?

kiphaas7’s picture

#20: 1010080_20a.patch queued for re-testing.

kiphaas7’s picture

Issue tags: +Needs backport to D7

Added tag.

kiphaas7’s picture

Status: Needs review » Reviewed & tested by the community

Patch was tested against D8 and came back green. Since it was previously tested against D7 and set to RTBC per #21, I'm taking the liberty of setting it back to RTBC....

sun’s picture

Status: Reviewed & tested by the community » Needs work

The code should explain in a comment why z-index 1 and not higher or lower. Table headers do use a higher z-index normally, right? Also, if this quirk applies to certain browsers/versions only, then mentioning those wouldn't hurt either. Place that comment right above the z-index line.

kiphaas7’s picture

My pc currently has firefox 4.01, opera 11.10, Chromium 11.0.697.0 and IE 8. I tried all of them with the situation shown in the screenshots of #1, and all of them (IE 8 also in compat mode) exhibit this behavior. So it's probably not a quirk, but expected behavior.

What do you mean by table headers, sticky table headers or regular table headers? In any case, I quickly grepped an entire D7 folder for z-index to be sure, and couldn't find a z-index declaration for any (relevant) table property.

As far as the code comment, would the following suffice?
...headers. To make sticky headers overlap these elements again, a z-index of at least 1 is needed.

Or would you expect a more lengthy explanation? I'm hesitant to do so, since z-index is a nasty subject containing stacking order, default values and IE quirks. Which is, to me, out of scope for a simple code comment.

kiphaas7’s picture

Status: Needs work » Needs review
StatusFileSize
new656 bytes

patch with proposed comment addition.

kiphaas7’s picture

StatusFileSize
new1.16 KB

Or a much more extensive code comment...

sun’s picture

StatusFileSize
new549 bytes

Thanks! Though now you slightly went overboard with those comments.

Attached patch hopefully clarifies why it's extremely helpful and necessary to properly document the non-obvious.

Please do not complain about the syntax of the comment. We don't have a coding standard for CSS comments yet, and it's particularly hard to draw a conclusion, because there are no solid examples, and CSS syntax doesn't make it easy either. If you want to help, see you over in #748810: CSS Coding Standards: Comments. Until that issue is resolved, this comment style made most sense for me in this particular situation.

kiphaas7’s picture

Looks great, although it's not really clear to me why you upped the z-index from 1 to 100?

sun’s picture

Drupal is a modular system, but it doesn't have any defined rules for modular element positioning in the viewport.

The default is obviously 0 and regular stacking depends on the markup order in the DOM. A module may add a form element with an advanced layout that should still be rendered below sticky table headers. A theme's layout/design may be based on absolute or relative positioned elements, but sticky table headers should still appear on top. Yet another module may add an absolute or fixed positioned element to the viewport, which always be on top. Some arbitrary examples:

Toolbar uses 600, Overlay uses 500, Contextual links use 999, Administration Menu uses 999, Views UI contextual/admin links use just 50, Autocomplete uses 100.

Using 1 would mean that other potentially positioned elements may still be rendered above sticky table headers when scrolling. Using 100 gives modules and themes sufficient room to position other elements. It's possible that the added comment doesn't sufficiently clarify this, so feel free to re-word it.

It's badly time for designers and themers to have a discussion on setting up formal rules for dividing the viewport into z-axis layers. Otherwise, the only viable solution in a modular system would be usage of JavaScript to apply appropriate z-indexes for all elements, but requiring JS for CSS layout is obviously a bad idea. We should have this discussion as soon as possible (in a separate issue).

kscheirer’s picture

Status: Needs review » Needs work

The last submitted patch, drupal.system-sticky-tableheaders.34.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Issue summary: View changes
Status: Needs work » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative
StatusFileSize
new24.62 KB

I don't think the sticky header is there anymore, at least, not in the example from the initial screenshot. Tested in Seven and Claro but the field label is not sticky:

If anyone knows how to get a sticky label, please update the issue with steps to reproduce and set it back to Active.