Mouse loses scrollbar when element is updated
Reported by
thomas.m...@gmail.com,
Apr 12 2018
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Steps to reproduce the problem: 1. Open the attached bug.html. The current time is displayed in a gray element and updated every second. 2. Click and hold the left mouse button on the scrollbar in the gray element and slowly move the mouse down 3. Within one second the mouse loses the scrollbar and you are not able to scroll any further What is the expected behavior? You should be able to scroll for as long as you want What went wrong? When the element's innerhtml is updated, the mouse is no longer holding on to the scrollbar. Did this work before? N/A Does this work in other browsers? No The same problems occurs in Opera, but not Firefox or Edge. Chrome version: 65.0.3325.181 Channel: stable OS Version: 10.0 Flash Version:
,
Apr 12 2018
Looks like the scrollbar is being recreated each time the timer fires. This is a layout stability issue.
,
Apr 12 2018
FWIW, there's a simple workaround, split up the current div into one that causes the overflow (and scrollbars) and one that houses the content.
<div style="display: grid; height: 200px">
<div style="overflow: auto">
<div style="height: 400px; background-color:#cccccc">
<div id="test"><!-- CONTENT GOES HERE --></div>
</div>
</div>
</div>
,
Apr 13 2018
Marking as untriaged so layout team actually sees it
,
Apr 23 2018
Setting the inner html removes all the old content (and thus the auto scrollbar) before creating the new content and, if it still overflows, creates a new scrollbar. This is by design and working as intended. Setting overflow to scroll instead preserves the scrollbar across invocations.
,
Apr 24 2018
I am using Chrome 66.0.3359.117 and I am still seeing the same problem with the workaround suggested in comment 3. https://jsfiddle.net/dgtmgam9/15/
,
Apr 24 2018
Yeah, sorry - the overflow: auto div needs to have an explicit height: https://jsfiddle.net/dgtmgam9/20/ Or make the top level div overflow: auto: https://jsfiddle.net/dgtmgam9/19/ |
||||
►
Sign in to add a comment |
||||
Comment 1 by nzolghadr@chromium.org
, Apr 12 2018Labels: Hotlist-Input-Dev
Status: Available (was: Unconfirmed)