Setting scrollTop during smooth scroll does not eventually scroll to that scrollTop. |
||
Issue descriptionIn the scroll interruption tests we try to cancel a scroll with a smooth scroll, and then cancel that smooth scroll to start the next test case by setting scrollTop. There seems to be a bug in that we continue to smooth scroll for a frame or two and don't end up at the set scroll position.
,
Jan 6 2017
,
Dec 14 2017
This is causing a huge issue for us in our chat app. If you imagine a Facebook chatbox, the most recent messages, and the scroll position are set to begin at the bottom of the scrollable element. Then as you scroll upwards, new content (older messages) is added above and the scroll position is then set to compensate. On all other browsers the result is smooth, perfect scrolling while this content is added. In Chrome however, after setting the scrollTop to account for the newly added content, any momentum left from smooth scrolling with the mousewheel overrides the new scrollTop, continuing from it's previously set position. Ultimately, this causes a huge jumping effect. If you were to track the scroll position each from it would look something like the following: Read scrollTop: 1000 Read scrollTop: 945 Read scrollTop: 903 Read scrollTop: 876 SET SCROLLTOP : 2056 Read scrollTop: 849 Read scrollTop: 821 Read scrollTop: 811 Read scrollTop: 799
,
Dec 14 2017
In a nutshell, the off main thread scrolling physics should take into account any changes to the scrollTop, made via javascript. So that the above example, fired from a single mousewheel "roll", looks more like this: Read scrollTop: 1000 Read scrollTop: 945 Read scrollTop: 903 Read scrollTop: 876 SET SCROLLTOP : 2056 Read scrollTop: 2012 Read scrollTop: 1984 Read scrollTop: 1957 Read scrollTop: 1941 |
||
►
Sign in to add a comment |
||
Comment 1 by ajuma@chromium.org
, Nov 21 2016