The ‘back’ function in Safari/iOS (iPhone 8, latest iOS version) is unreliable; when going from the topic list to a topic, it will often not take you back to the correct position in the topic list. On my own forum this happens pretty much always. On Meta, it sometimes works for me, but more often it doesn’t. This happens both when clicking the ‘back’ button and when swiping to the right.
Out of curiosity does it work in safe mode ?
Sorry I forgot to mention that: I tested safe mode both on my own forum and here on Meta with the same result.
In the iOS hub app or in native mobile safari? I can’t repro any problem using the back button or back swipe from the topic list here on meta.
Do you have specific repro steps?
Oh wait, I can repro for back swipe, but not back button. Back swipe doesn’t seem to remember the actual scroll position in the topic list, but back button always does.
In native mobile safari. At first I had a hunch it was related to the topic list refreshing, but that doesn’t seem to be the case. It happens 100% of the time for me on Meta now.
- Log in to Meta
- Reload the Meta homepage (this step doesn’t seem necessary but I wanted to rule out the topic list refresh issue)
- Scroll one page down
- Select a topic
- Swipe right or click back
I also tried the following, all with the same result:
- Disabled the Crystal ad blocker in content blocking.
- Opened Meta in a private tab without logging in.
- Tested on an iPhone SE.
- Tested in Chrome on a Galaxy S6
This should fix it:
Details inside commit message, will wait for robin approval before merging this next week. Thanks for detailed report
This is merged, let me know how it goes please.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
After a discussion with @bartv I investigated more and discovered that there is indeed a regression.
I think it’s coming from:
Basically in this case, scrollOnLoad is undefined:
I suggest the following fix:
Can you review next week @markvanlan please?
@bartv I just merged the second fix, please let me know how it goes when you get some time.
As a side note, I wonder if we couldn’t improve this logic even more? ATM it’s storing the position of one topic at each page scroll, but especially on mobile it can mean that when you come back the topic you clicked on is not in viewport, even if not very far.
I just tested here on Meta but it doesn’t work for me - when I tap ‘back’ from a topic, I return to the top of the topics list.
And +1 to returning to the exact position in the topic list.
It does work for me, please make a video when you have time.
I added it to my post. Hope it helps, let me know if you need me to include other things.
What the video shows is expected, you didn’t do a « page scroll », as in it did’t load more topics, so it didn’t update last seen topic position.
This is what my sidenote proposed to improve.
Ah, I can confirm that it DOES work when I scroll down far enough to force new topics loading. I didn’t expect that limitation - as a user that’s a little confusing/inconsistent.
Yes I don’t like it that much too, hence why I proposed we improved it. But AFAIK this is not a regression as the other things I fixed.
Damn there was indeed another regression from this commit and I think this should solve it:
and bring the behavior we were talking of!