-
Notifications
You must be signed in to change notification settings - Fork 694
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
[css-position] Sticky positioning with transform between it and reference box #3186
Comments
This looks like a bug in Gecko... Probably some edge case which was not considered for sticky. Have you filed the bug to Gecko? |
@upsuper I've filed a few issues against |
In light of at least ios safari using |
@upsuper the original test case provided by @Loirooriol no longer moves "discretely and buggy" in the latest firefox nightly. But if Should I file an issue for this? Or wait until the csswg weighs in? |
I still see the problem in latest nightly, filed https://bugzilla.mozilla.org/show_bug.cgi?id=1519073 |
Okay, so Chrome is behaving as intended. It's a little wacky, but layout (including stickypos) happens before transforms do, so yeah, scrolling should shift the sticky element sideways in this case. Firefox's behavior is just a quality-of-implementation issue. Do you think we should include this in an example or a note somehow, or just leave it as a fun easter egg for people to stumble across? |
Probably an example is not needed, but it could be useful to note that a sticky box may end up being painted outside of the sticky view rectangle (even if the intersection with the containing block is not empty) because of transforms, or something like that. |
Hi, I am one of the guys who just found the easter egg (I guess). My scenario is sticky positioning relatively to the scrolling container other than the https://jsfiddle.net/martinh_kentico/wbybegxy/11/ But when you uncomment Is it the same problem you are discussing above? Can it be fixed somehow while maintaining the |
CSS Transforms can distort elements a lot. However, this wasn't a big problem for
top
,left
,bottom
andright
properties, because transformed elements generate a containing block for all descendants.However, sticky positioning is special because the insets are not calculated with respect to the containing block, but an scrollable ancestor instead. https://drafts.csswg.org/css-position/#sticky-position
This can make things unintuitive, sticking the untransformed element to an edge of the ancestor may not look like stickment at all after the transform.
http://jsfiddle.net/ns68kdxt/
Scrolling down moves the sticky element from right to left smoothly in Chromium. Seems OK but unintuitive. It moves discretely and buggy in Firefox.
Should sticky positioning still work in this case? What about similar cases like
contain: strict
, should scrolling an element outside the containment affect a sticky element inside the containment?The text was updated successfully, but these errors were encountered: