# Flagging sometimes loses scroll position

**URL:** https://meta.discourse.org/t/flagging-sometimes-loses-scroll-position/98895
**Category:** Bug
**Created:** [October 6, 2018, 5:38pm UTC](https://meta.discourse.org/t/flagging-sometimes-loses-scroll-position/98895 "2018-10-06T17:38:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Woodcock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/woodcock/32/113539_2.png) [@Woodcock](https://meta.discourse.org/u/Woodcock)
#### Post date: [October 6, 2018, 5:38pm UTC](https://meta.discourse.org/t/flagging-sometimes-loses-scroll-position/98895/1 "2018-10-06T17:38:01Z")

</div>

Flagging a message occasionally causes the browser to lose scroll position – it jumps back XX number of messages.I don’t have a rock solid pattern to reproduce this, but it would seem to happen most on an iPhone (mine is 6s with iOS 12), longer topics (dozens or 100+ messages) and flagging with a custom reason.

This issue has been around a long time (longer than I have used Discourse). I finally decided to report as iOS 12 or Discourse 2.1 upgrade did not seem to make an improvement to this. Not a huge issue of course, as this only impacts busy forums and active flaggers, but kinda weird anyway.

---

<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 7, 2018, 11:10am UTC](https://meta.discourse.org/t/flagging-sometimes-loses-scroll-position/98895/2 "2018-10-07T11:10:47Z")

</div>

We need a solid repro here. Try on [try.discourse.org](http://try.discourse.org), there is a 1000 reply topic in there to test with.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [October 7, 2018, 6:25pm UTC](https://meta.discourse.org/t/flagging-sometimes-loses-scroll-position/98895/3 "2018-10-07T18:25:27Z")

</div>

> [@codinghorror](#):
>
> We need a solid repro here.

That’s the problem I have. I’ve narrowed it down to iPad Safari modals (Flag, edit revision history, post composer). The best I can come up with is that the “event” is propagating to the timeline scroller. But because I have so far been unable to cause it to happen consistently that’s still only a best guess.

---

<div class="post-metadata">

### Author: ![Woodcock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/woodcock/32/113539_2.png) [@Woodcock](https://meta.discourse.org/u/Woodcock)
#### Post date: [October 24, 2018, 12:44pm UTC](https://meta.discourse.org/t/flagging-sometimes-loses-scroll-position/98895/4 "2018-10-24T12:44:51Z")

</div>

I have been testing this and this happens far more often than it does not – I’d say around 85% repro, but I can’t figure out how to get it to 100%.

@codinghorror But I did learn something – the event does not have to be flagging. I just temporarily closed a topic of 419 posts, and I was bounced back to message number 336.
