[css-grid] Div scrolls to top when changing static to fixed
Reported by
wouter.a...@gmail.com,
Jan 30 2018
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0 Mobile/15C202 Safari/604.1 Steps to reproduce the problem: https://stackoverflow.com/questions/48516984/chrome-resets-scroll-position-with-css-grid-and-overflowauto What is the expected behavior? No auto scroll to top should occur What went wrong? Element scrolls to top Did this work before? N/A Chrome version: 64 Channel: n/a OS Version: Latest Flash Version: Grid layout + overflow:auto seems to cause this
,
Jan 30 2018
,
Feb 1 2018
Posted a repro at http://bokand.github.io/bugs/807252/index.html, click anywhere to toggle the bar's position style. I ran it through a debugger and the change in scroll comes from clamping after layout. There's a bug in layout somewhere, at the time of the clamp, the scrolling box thinks it's clip is the same size as the content, hence the clamp. Afterwards it's correctly sized allowing normal scrolling. This sounds like a bug somewhere in the layout code.
,
Feb 1 2018
Should mention, this repro'd for me on Linux.
,
Feb 1 2018
,
Feb 1 2018
I'm not sure if this is a bug or not, the very same thing happens in Firefox. If the element has "position: static", it's expected to be painted where it is. Could you provide screenshots/screencasts or explain better whats the problem? Could you verify if it works properly in other browsers: Firefox, Edge, Safari?
,
Feb 1 2018
It works correctly in Firefox. More complete repro steps: 1) Open http://bokand.github.io/bugs/807252/index.html 2) Resize the window so there is vertical scroll extent 3) Scroll down 4) Click anywhere Expected: The pink bar disappears, the scroll offset doesn't change Actual: The pink bar disappears but the scroll offset is reset to the origin.
,
Feb 1 2018
,
Feb 2 2018
Ok, thanks got it now. I'm able to reproduce. I thought it was related to the position of the element, not about the scroll sorry. Thanks for the detailed steps. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by dtapu...@chromium.org
, Jan 30 2018