1. 15
  1. 1

    How does this website manage to break back-swipe functionality so badly? If I scroll down past the first section, attempting to swipe back results in some sort of insane JavaScript shit going on and preventing me from actually going back to where I was. Even pop-ups don’t manage to be this annoying. Besides this being an insane choice on the part of the page developers (provided it’s intentional), it also insane that mobilesafari allows this behavior.

    1. 1

      It’s a behaviour I’ve seen far too frequently, especially in JS-based slide presentation frameworks.

      What’s likely happening is that behind the scenes they’re manipulating the browser’s history state when you scroll down to a new section. Upon scrolling to each section, they add the id of that section (e.g. #introduction, or #tutorial) to the tab’s history, probably using history.pushState(). That’s why when you do a ‘back’ operation, instead of coming back here to Lobsters, your browser instead pops one of those additional history items off of the history stack. It’s easier to see this happening with a browser that shows the complete url (including its /#tutorial part). They should’ve instead used history.replaceState() to avoid adding extraneous history items for each of the sections you scroll past.

    Stories with similar links:

    1. F*: A Higher-Order Effectful Language Designed for Program Verification via sanxiyn 8 years ago | 11 points | 2 comments