New issue
Advanced search Search tips

Issue 805800 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Select in sticky element causing page scroll when rendering `:active` state

Reported by lizster...@gmail.com, Jan 25 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Steps to reproduce the problem:
1. Open up the test page
2. Scroll down the page.
3. Click the select dropdown

What is the expected behavior?
The main page shouldn't scroll anywhere as the select is fully visible.

What went wrong?
Page scrolled up to where the element is rendered in the page.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 63.0.3239.132  Channel: n/a
OS Version: OS X 10.13.2
Flash Version: 

If you click outside of the select to ensure it's no longer in focus and active, then scroll the page again, clicking on it will reproduce the problem.

When you scroll the page down again with the scroll wheel and the select is still 'active', clicking it again doesn't cause the page scroll.
 
bug-case.html
18.7 KB View Download
Components: Internals>Compositing>Scroll
Labels: Needs-Triage-M63
Cc: smcgruer@chromium.org
Labels: Needs-Bisect
Status: Untriaged (was: Unconfirmed)
I can repro on latest Canary. Let's bisect to see if this is a regression.
Cc: -smcgruer@chromium.org
Labels: -Pri-2 -Needs-Bisect -Needs-Triage-M63 Pri-3
Owner: smcgruer@chromium.org
Status: Started (was: Untriaged)
This is very unlikely to be a regression; I suspect we just have stale sticky data when the select box asks for the current location.

Comment 5 by ja...@javan.us, Feb 9 2018

I just tested Chrome 58 and this issue is present so it's not a recent regression, at least. Possibly related: https://bugs.chromium.org/p/chromium/issues/detail?id=746590 (and https://bugs.chromium.org/p/chromium/issues/detail?id=754328).

Comment 6 by ja...@javan.us, Feb 9 2018

Here's another possibly related issue I just reported: https://bugs.chromium.org/p/chromium/issues/detail?id=810895
Labels: -OS-Mac
To give an update on this: this bug is caused by stale sticky constraints. I am trying to figure out a patch to make sure they aren't stale, but ran into a tricky bit of code complexity where the focusing/scrolling code is called during lifecycle update (so it's not valid to request a lifecycle advance).

Hopefully we will be able to resolve the complexities and fix this, but ultimately this is another indication that sticky constraints need to be a layout-time calculation.
Cc: vamshi.kommuri@chromium.org
 Issue 824678  has been merged into this issue.
 Issue 851934  has been merged into this issue.
I explained the behind-the-scenes reasoning for why this happens and I don't think it really counts as a *bug*, but rather a simple design flaw since the browser engine is programmed in a specific way. 
 
Even if it is coded in a way where it would work properly, it likely has some problem with it (hence then it *is* a bug) like smcgruer@chromium.org mentioned.
 
I haven't looked at any of Chrome's source code myself, but my assumption is that it's told to check if an input field is offscreen by comparing the scroll position relative to the actual position written in the document/file. A lot of browsers have this issue and many others don't. The best way to fix this is to simply make it run the check by comparing the element's real-time position instead.
Here is a JSFiddle for anyone wanting to work on this issue: http://jsfiddle.net/d3Lku791/

In the meantime, is there a workaround other than storing the current scroll position and restoring it?
 Issue 873233  has been merged into this issue.
I've had this issue for long time as well, but it seems that it works properly now on Chrome Canary 71 :).
Cc: smcgruer@chromium.org
Owner: adithyas@chromium.org
Status: Fixed (was: Started)
You are probably looking for a change made after 592438 (known bad), but no later than 592440 (first known good).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/badbd1c5b6149dafb126de7cbf83fa04eb48e339..e1aa11528e75bad7d7676d44970338a8e1c12a6b

This was likely fixed by adithyas@'s change in http://crrev.com/https://chromium.googlesource.com/chromium/src/+/e1aa11528e75bad7d7676d44970338a8e1c12a6b

Sign in to add a comment