# Scroll position issue for topic with 1 unread post

**URL:** <https://meta.discourse.org/t/scroll-position-issue-for-topic-with-1-unread-post/82683>\
**Category:** Bug\
**Created:** [March 10, 2018, 3:50pm UTC](https://meta.discourse.org/t/scroll-position-issue-for-topic-with-1-unread-post/82683 "2018-03-10T15:50:50Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [March 12, 2018, 3:16pm UTC](https://meta.discourse.org/t/scroll-position-issue-for-topic-with-1-unread-post/82683/11 "2018-03-12T15:16:51Z")

</div>

> [@sam](#):
>
> which is calling offsetCalculator 3 times for some reason - do we know why ?

It is super ugly, but it was the only thing that worked consistently when I wrote the code. I had many bugs with it displaying in the wrong place and noticed it worked properly if you tried a few times in a row.

> [@sam](#):
>
> So I guess my big question is, do we need to carry all this fancy or should we simply amend it to always try to place the post highlighted a few pixels below header?

The logic is used in several places, notably in the scrolling post stream to determine what post you’re currently looking at. What worries me if we replace lock-on with a different algorithm, is our eyeline tracking broken now?

Replacing this could cause a lot of regressions, particularly when the header has been customized by CSS to be larger or to contain custom content.

I have a lot on my plate right now, so my vote would be to revert jQuery for now if that’s the cause and revisit when we have more time.

---

_[View the full topic](https://meta.discourse.org/t/scroll-position-issue-for-topic-with-1-unread-post/82683)._
