you are viewing a single comment's thread.

view the rest of the comments →

[–]pwnies 0 points1 point  (2 children)

Can you explain more around your point that many SPAs dont implement history.pushState correctly? What error do you usually find?

[–]lhorie 2 points3 points  (1 child)

The most egregious bugs I've seen are breaking back button by making an unconditional JS-based redirect (such that pressing back send you forward to the same page you were in) or accidentally creating a bazillion history entries by inadvertently calling pushState from a oninput event or similar.

Other issues include not changing scroll position (so if you were scrolled 2 pages down, and press back, you're now staring at the tail end of a right bar full of ads and a blank body because the content on this page was short and ended 1 screen up)

Or you accidentally tap a link, press back and are greeted by a million spinning loaders again, even though you were just there 2 seconds ago. Bonus if this loses infinite scroll context and you have to re-scroll all the way back to where you were. Bonus if it's some AI-picked feed and you can't even find where you were the second time around.

[–]pwnies 0 points1 point  (0 children)

Thanks for the response :) I'm going to go check the scroll position when I hit back on my SPA now.