-
Notifications
You must be signed in to change notification settings - Fork 719
[css-position-3] Revisit the scroll position of sticky-positioned boxes #7930
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
Labels
Comments
@tabatkins WDYT? |
The CSS Working Group just discussed
The full IRC log of that discussion |
tabatkins
added a commit
that referenced
this issue
Jan 6, 2023
jakearchibald
pushed a commit
to jakearchibald/csswg-drafts
that referenced
this issue
Jan 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In #1459 I raised an issue around the behavior of scrolling sticky elements (or descendants) into view. In particular since scrolling an element into view used the sticky element's current bounding border box returned from getBoundingClientRect, this could result in:
top: 0
are linked to in the anchor or the anchor itself is a part of the sticky element not at the top the anchor will (usually, unless resricted by their containing block) move after you scroll to their previous location.As a result, we updated the spec to use the non-offsetted position for scroll operations.
Since this update, chromium implements this behavior behind experimental web platform features which fixes this issue as well as issues with input fields combined with scroll-padding (e.g. bug 1178622) however the experimental behavior has also raised many bugs about the scrolling being unexpected (e.g. bug 1334207). I expect we will see many more bugs filed if we attempt to enable this behavior by default as input fields within sticky headers is a common practice for search fields.
The TLDR, we have two options:
I propose that we revert the spec change and go back to the currently shipping behavior (option 1) for two main reasons:
position: sticky
use is rapidly increasing (at roughly 12.5% of Chrome page loads right now). Changing this is likely to break the experience on a lot of those sites.scroll-margin
to the particular elements that may be scrolled into view, though this is cumbersome.The text was updated successfully, but these errors were encountered: