New issue
Advanced search Search tips

Issue 807252 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 2
Type: Bug



Sign in to add a comment

[css-grid] Div scrolls to top when changing static to fixed

Reported by wouter.a...@gmail.com, Jan 30 2018

Issue description

UserAgent: 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
 
Components: -Blink Blink>Scroll
Labels: Needs-Triage-M64

Comment 3 by bokan@chromium.org, Feb 1 2018

Cc: bokan@chromium.org
Components: -Blink>Scroll Blink>Layout
Status: Untriaged (was: Unconfirmed)
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.

Comment 4 by bokan@chromium.org, Feb 1 2018

Labels: OS-Linux
Should mention, this repro'd for me on Linux.

Comment 5 by e...@chromium.org, Feb 1 2018

Cc: r...@igalia.com
Components: -Blink>Layout Blink>Layout>Grid
Status: Available (was: Untriaged)

Comment 6 by r...@igalia.com, Feb 1 2018

Cc: jfernan...@igalia.com svil...@igalia.com
Status: Unconfirmed (was: Available)
Summary: [css-grid] Div scrolls to top when changing static to fixed (was: Div scrolls to top when changing static to fixed)
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?

Comment 7 by bokan@chromium.org, 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.

Comment 8 by bokan@chromium.org, Feb 1 2018

Status: Available (was: Unconfirmed)

Comment 9 by r...@igalia.com, 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