New issue
Advanced search Search tips

Issue 767955 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Changing height of position: sticky on scroll causes infinite loop

Reported by proskate...@gmail.com, Sep 22 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Steps to reproduce the problem:
1. Set position: sticky on element
2. Change height of sticky element at scroll threshold, usually via a JavaScript listener on window scroll to change a CSS class

What is the expected behavior?
You scroll page to threshold, which causes sticky element to change height

What went wrong?
When you scroll to threshold, JavaScript applies special class to document that tells the sticky header to change its height, which then causes the 'scroll' event to fire again for some reason, which now has a different value, so the JavaScript listener sees the scrollTop as different and removes the special class, causing an infinite loop.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 60.0.3112.113  Channel: n/a
OS Version: 10.0
Flash Version: 

You can see the correct behavior in Firefox screencap. Chrome seems to change the scroll position of the document after the sticky element changes its height. Firefox seems to handle correctly, where the height of an element should not adjust the scroll position, but rather just add extra height to the document's height.
 
sticky-header-resize.html
3.8 KB View Download
chrome-sticky-header-resize-bug.gif
523 KB View Download
firefox-sticky-header-resize.gif
353 KB View Download
Labels: Needs-Triage-M61

Comment 2 by nainar@chromium.org, Sep 25 2017

Components: -Blink>CSS Blink>Layout

Comment 3 by e...@chromium.org, Sep 25 2017

Owner: skobes@chromium.org
Status: Assigned (was: Unconfirmed)
Steve, is this scroll anchoring kicking in?

Sign in to add a comment