Back button doesn't save scroll position in list
-
- Go to unread
- Scroll down half a page, while skimming topic titles
- Go "oh, there's one I want to check on".
- Click on it. Catch up real quick.
- Click BACK
- FUCKING HELL WHY AM I BACK AT THE TOP OF THE PAGE NOW I HAVE TO SCROLL ALL THE WAY DOWN AGAIN AND RE-READ ALL THESE FUCKING TITLES!
ps: I'm posting this in Chrome Latest so fuck you with the FF28lol fuckers
-
@lorne-kates Your browser remembers your position on pages because it caches the page. Dynamically generated pages like topic lists aren't applicable. In case you're confusing that with saving your position in a thread, that's done by changing the current URL every time you scroll.
And NodeBB has serious jellypotato with Back and Forward sometimes - you can even overwrite your back/forward history if you do it right. Best to just ignore them if there's a readily accessible link to the page.
-
@pie_flavor said in Back button doesn't save scroll position in list:
@lorne-kates Your browser remembers your position on pages because it caches the page. Dynamically generated pages like topic lists aren't applicable. In case you're confusing that with saving your position in a thread, that's done by changing the current URL every time you scroll.
And NodeBB has serious jellypotato with Back and Forward sometimes - you can even overwrite your back/forward history if you do it right. Best to just ignore them if there's a readily accessible link to the page.
I'd be happy with .Net's one-third-ass implementation of:
pseudo
OnBeforePageNavigateOrPostback() { LastScrollPosition = WindowScrollPosition(); } OnAfterPagePostback() { if(LastScrollPostion != null) Window.DoScrollTo(LastScrollPosition) }
-
@pie_flavor said in Back button doesn't save scroll position in list:
you can even overwrite your back/forward history if you do it right.
Why am I even explaining this to you? God dammit I settle into the whole 'just ignore the bugs' mindset too easily.
https://what.thedailywtf.com/topic/24712/back-forward-buttons-can-overwrite-the-back-forward-history
-
The HTML5
pushState
/replaceState
methods let you include astateObj
object. It'd be fairly trivial to put the scroll position intostateObj
, and it'd then be available when the user uses the back button so that the script could scroll to the same location.
-
What's worse is that the scroll list is infiniscroll, so even though the browser tries to scroll there, it doesn't exist as it needs to be inifini-loaded first, and the browser only tries a maximum of once to get there.
-
@tsaukpaetra What? It's not infiniscroll on my screen.
Mind you, I might have turned that off if there's a setting for it. But still.
-
@pie_flavor said in Back button doesn't save scroll position in list:
God dammit I settle into the whole 'just ignore the bugs' mindset too easily.
something something Discodev something BANNED!
-
@pie_flavor said in Back button doesn't save scroll position in list:
Mind you, I might have turned that off if there's a setting for it.
Hmm, the Discodev has done his homework on "how to blend in".
hehehe-- go to meta.derp and post a thread asking for a paged option. hehehehehehHEHEHEHEHEHAHAHAHH!
-
@lorne-kates said in Back button doesn't save scroll position in list:
hehehe-- go to meta.derp and post a thread asking for a paged option. hehehehehehHEHEHEHEHEHAHAHAHH!
Try visiting meta.discourse.org with a GoogleBot user agent...
-
@anotherusername said in Back button doesn't save scroll position in list:
@lorne-kates said in Back button doesn't save scroll position in list:
hehehe-- go to meta.derp and post a thread asking for a paged option. hehehehehehHEHEHEHEHEHAHAHAHH!
Try visiting meta.discourse.org with a GoogleBot user agent...
Try visiting it with Javascript turned off.
We all know Discourse CAN be displayed light-weight and with paging. But some dumb fucking idiot asshole (jeff i'm talking about jeff) refuses to provide that feature to end users.
edit ahahahahah they actually present different content to a Googlebot than to a regular (non-Javascript) user HHAAHAHA how the fuck have they not been SEO slapped hard for that?!?!
And double HAHAHAHAHAH for them not doing a reverse-lookup on a client claiming to be a Googlebot. That doesn't open them up for abuse AT ALL!
-
@anotherusername said in Back button doesn't save scroll position in list:
The HTML5
pushState
/replaceState
methods let you include astateObj
object. It'd be fairly trivial to put the scroll position intostateObj
, and it'd then be available when the user uses the back button so that the script could scroll to the same location.An update on this -- I floated the idea to @baris because we already do this for categories. If you enter a topic from a category and hit back, we return you to the category at the spot you were at (roughly*, anyway), and highlight the topic** you had clicked as a visual reminder.
The difficulty lies in the fact that when you click an unread topic and go back... the topic doesn't exist in that list anymore because you visited it. Nor do we have a way to go to "page 2" of an unread list, but I may be wrong about that.
* We infinite load the posts again and scroll you back down.
** We totally stole this from Discourse. We thought it was neat.
-
@julianlam said in Back button doesn't save scroll position in list:
** We totally stole this from Discourse. We thought it was neat.
I hope you only stole the idea, and not the implementation. Otherwise you'll need a few extra CDNs to host all the personal information the feature leaks.
-
It might've been Flarum too, I forget. We like Flarum's design a lot.
-
@julianlam said in Back button doesn't save scroll position in list:
The difficulty lies in the fact that when you click an unread topic and go back... the topic doesn't exist in that list anymore because you visited it.
The most ideal would be to highlight the topic that was immediately following the one you clicked.
Less ideal but still probably acceptable would be to highlight the topic that's now in the position (nth item in list) that the one you clicked on was (which could be affected by new posts bumping topics to the top of the list), or even just scrolling the page to the same y-position as it was.
But I don't usually use
/unread
, so topics moving just because I read them wouldn't necessarily apply (although it'd still move if someone replied to it).Nor do we have a way to go to "page 2" of an unread list, but I may be wrong about that.
It seems to work for me in paginated mode. Back returns me to the same page of unread as before (though not to the same scroll position).
-
@julianlam said in Back button doesn't save scroll position in list:
highlight the topic** you had clicked as a visual reminder.
Ah, so that's what it was trying to indicate with that... It... Kinda works?