Changing height of position: sticky on scroll causes infinite loop
Reported by
proskate...@gmail.com,
Sep 22 2017
|
|||
Issue descriptionUserAgent: 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.
,
Sep 25 2017
,
Sep 25 2017
Steve, is this scroll anchoring kicking in? |
|||
►
Sign in to add a comment |
|||
Comment 1 by manoranj...@chromium.org
, Sep 22 2017