# Scroll jank when scrolling up

**URL:** https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381
**Category:** Feature
**Created:** [February 5, 2019, 4:48am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381 "2019-02-05T04:48:49Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [February 5, 2019, 4:48am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/1 "2019-02-05T04:48:49Z")

</div>

Scroll to the bottom of a long thread and refresh the page.

Grab the scroll bar and scroll up to the top of the page. You’ll see a loading spinner while the previous posts load. (You can make this problem more obvious using a network conditioning tool, e.g. Chrome Dev Tools Network tab, Slow 3G.)

Actual: As the posts load, the scroll jumps around.

In the linked video, you can see that RBoy’s post #76 “Maybe codinghorror can confirm” is at the top of the screen; then, when the subsequent page finished loading, the scroll jumps up to lid’s post #9 “It will be interesting to see if…”

> **[scrolljank-original.mov](https://drive.google.com/file/d/1ny2zYNegggQ3uPlhG9t-tEB3xkUSepcE/view?usp=drive_open)**
>
> Google Drive file.

Expected: The previous page should appear without disturbing the scroll position; whatever I saw on the screen as the previous page loads should still be on the screen when it’s drawn in.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [February 5, 2019, 4:54am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/2 "2019-02-05T04:54:32Z")

</div>

Onebox seems not to be working with my Google Drive link. Let’s see if this works: [https://drive.google.com/open?id=1ny2zYNegggQ3uPlhG9t-tEB3xkUSepcE](https://drive.google.com/open?id=1ny2zYNegggQ3uPlhG9t-tEB3xkUSepcE)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [February 5, 2019, 5:15am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/3 "2019-02-05T05:15:42Z")

</div>

That just looks like posts are loading as you scroll up. It’s worse when you limit network speeds because the data takes longer to traverse a slower network.

Try scrolling using the handle on the timeline scroller. It won’t jump around because more posts aren’t being loaded ahead and causing the position of the scrollbar to be recalculated. It’s a big part of why it’s there to begin with.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [February 5, 2019, 5:21am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/4 "2019-02-05T05:21:07Z")

</div>

I agree that this is happening because the posts are loading. With a slow network, I can reproduce this just scrolling with trackpad/mouse wheel. (Would it help to post a demo video of that?)

This problem is occurring only when scrolling _up_ because when scrolling down, Discourse draws in a bunch of grey filler; when the posts become available, they pop in right where they’re supposed to be and the scroll doesn’t jank.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [February 5, 2019, 5:23am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/5 "2019-02-05T05:23:29Z")

</div>

It happens because pages are rendered from top to bottom, Discourse doesn’t know the height of posts before they arrive. I can see the scrollbar hopping around as you drag up, using the scroller at least mitigates against the problem by scrolling to the absolute top of each reply.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [February 5, 2019, 5:26am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/6 "2019-02-05T05:26:48Z")

</div>

I think all that’s needed is grey filler at the top, just like scrolling down.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 5, 2019, 6:01am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/7 "2019-02-05T06:01:46Z")

</div>

@eviltrout spent a fair amount of time optimizing up scroll, it was quite a few years ago so maybe we are due to have one more look

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 5, 2019, 11:18am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/8 "2019-02-05T11:18:47Z")

</div>

For the record, this is a very difficult problem. And scrolling down is fundamentally different because you’re not stacking things on top of the viewport. A variable height post causes no problems when added to the bottom, but consider what it does when stacked on top.

---

<div class="post-metadata">

### Author: ![littleviolette](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@littleviolette](https://meta.discourse.org/u/littleviolette)
#### Post date: [September 1, 2021, 7:19am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/9 "2021-09-01T07:19:42Z")

</div>

Our community recently has started experiencing jumpy and glitchy screen when scrolling up too:

https://www.youtube.com/embed/M6-0H9pr7Xo?feature=oembed&wmode=opaque

[![](https://global.discourse-cdn.com/meta/original/4X/9/a/9/9a9b2dbabbb7a5ad8be7ceba2bb939ee389d2176.jpeg "Scrolling issue iPhone leasehackr") ](https://vimeo.com/575883067)

Is this purely a software issue? Anything else we can do to optimize the user experience while scrolling up?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [September 1, 2021, 7:30am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/10 "2021-09-01T07:30:54Z")

</div>

Does it happen without ads ?

---

<div class="post-metadata">

### Author: ![littleviolette](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@littleviolette](https://meta.discourse.org/u/littleviolette)
#### Post date: [September 1, 2021, 7:43am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/11 "2021-09-01T07:43:08Z")

</div>

Yes it does. I don’t see ads as a moderator and scrolling up is still glitchy.

Is it sensible to have to software not “jump back” if the users scroll up too fast? I assume the issue is caused by the user scrolling up too fast so the posts don’t get properly rendered, as explained above. I would rather have the screen freeze than jumping back after the previous posts are done loading, which confuse users.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [September 1, 2021, 9:25am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/12 "2021-09-01T09:25:44Z")

</div>

Also curious what happens in safe-mode ? [Using Safe Mode to troubleshoot issues with themes and plugins](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 7, 2021, 10:34pm UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/13 "2021-09-07T22:34:08Z")

</div>

Does it also happen in [safe mode](https://meta.discourse.org/t/53504?silent=true) @littleviolette ?

---

<div class="post-metadata">

### Author: ![littleviolette](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@littleviolette](https://meta.discourse.org/u/littleviolette)
#### Post date: [September 7, 2021, 11:20pm UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/14 "2021-09-07T23:20:48Z")

</div>

I just tried to replicate the issue in both the normal and [safe mode](https://meta.discourse.org/t/53504?silent=true). I was not able to replicate the issue. I updated Discourse 2 days ago – not sure if that has changed any behavior. I will ask my community for further feedback. Thank you for following up!

---

<div class="post-metadata">

### Author: ![tempogain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tempogain/32/134055_2.png) [@tempogain](https://meta.discourse.org/u/tempogain)
#### Post date: [September 23, 2021, 10:25am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/15 "2021-09-23T10:25:16Z")

</div>

We’re also getting a lot of reports about this on our site. I tried now and found it’s still happening in [safe mode](https://meta.discourse.org/t/53504?silent=true). Some recent reports:

> **[Scrolling function has issues (Scroll Jank) - was fixed, happening again?](https://tw.forumosa.com/t/scrolling-function-has-issues-scroll-jank-was-fixed-happening-again/209548/77)**
>
> 🤔 Yes, those are the worst.

---

<div class="post-metadata">

### Author: ![Gussie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gussie/32/124983_2.png) [@Gussie](https://meta.discourse.org/u/Gussie)
#### Post date: [October 20, 2021, 12:17am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/16 "2021-10-20T00:17:13Z")

</div>

> [@On another topic](https://meta.discourse.org/t/209548/96):
>
> This video shows three instances of the scrolling issue reported in forums which use Discourse as their platform. Whilst simply scrolling through a forum thread, the screen jumps back to a previously read posting near where first starting.
> 
> **First time at about the 30 second mark**. After scrolling through some posts, it jumps back to @owleyes post responding to @Shaun008 “Oh I guess that’s for antibodies, not the PCR.” The scrolling issue didn’t happen again on this thread and I was able to navigate to the final post. Strangely, it didn’t happen on the next thread I looked at “Influenza - Vitamin C and vaccines”
> 
> **Second time in the “Diabetes Type 2 , possible cure!” thread at about the [2:27]**([https://www.youtube.com/watch?v=Zx697EjjeFY&t=147s](https://www.youtube.com/watch?v=Zx697EjjeFY&t=147s)) mark. It jumps back to the previously read posting by @Crusher responding to @nz’s posting of “Sugar. The problem is sugar.”
> 
> **Third time is still in the “Diabetes Type 2 , possible cure!” thread at about the [3:08]**([https://www.youtube.com/watch?v=Zx697EjjeFY&t=188s](https://www.youtube.com/watch?v=Zx697EjjeFY&t=188s)) mark. It jumps right back to the “Sugar. The problem is sugar.” from 1 day ago all the way back to 2 days ago which had already been read 3 times.

[![](https://global.discourse-cdn.com/meta/original/4X/5/3/f/53fc669b1ff309a710c2a01ee4277872df8ab436.jpeg "2021 10 05 Forumosa Scrolling Issue") ](https://www.youtube.com/watch?v=Zx697EjjeFY)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 23, 2021, 5:38am UTC](https://meta.discourse.org/t/scroll-jank-when-scrolling-up/108381/17 "2021-10-23T05:38:04Z")

</div>

We just fixed a bug where sites with unusual settings (don’t retrieve size of images) had problems with images causing scroll jump as the images resized. We have removed this setting since it was a “shoot yourself in the foot” setting. Maybe check and see if you had that enabled.

The other possible culprit is advertisements.

Basically anything that causes the viewport to dynamically resize will cause huge problems.
