Safari issue where returning to a collection after viewing a product jumps to top of collection again

A customer reported an issue that only occurs when using in safari on apple devices:

Normal (Android behaviour): Scroll through collection, click on product to view, when hitting back on product page, browser returns to same position on collection page.

When using Safari on an iPhone, hitting back returns the visitor to the top of the collection page every time and they have to scroll all the way back down to their last position in the collection. Not a great user experience!

I implemented the following script on the collection page to resolve the issue:

(why can’t I paste code here?)

Hey @13111y - I believe this is a known issue with Safari itself that pops up from time to time (just sharing this post from the Apple forums: Safari jumps to the top of the previous p… - Apple Community).

If the customer is using an older version of Safari on the iPhone, that might be the most likely reason for this popping up - but it is interesting that your script resolves the issue for sure (it is potentially possible it’s an issue on our end for sure if the script resolves things).

If you/the merchant are able to replicate the issue and can confirm if it only happens on a single version of Safari or on multiple (including the most recent one), I’m definitely happy to take a closer look into this for sure - just let me know!

I had another client test it on his site. I recently updated his site to the latest version of Dawn, and I know he uses an iPhone 15. The issue was confirmed and after implementing my script it was resolved.

It would be great if you guys could resolve it in the core and save me having to implement the code with every update or new client!

Hey @13111y - thanks for checking this with your other client and following up! If they’re using an iPhone 15, that likely means they’re using Safari 17 at least, so it is odd this would pop up. I still can’t say for sure if it’s an issue on our end, but I’m definitely happy to do some further looking into this internally for you.

Just for us to help reproduce things quickly, could you share:

  • The exact iOS and Safari version shown under Settings → General → About → iOS Version.

  • A storefront URL where the workaround script isn’t installed yet (so we can observe the raw behaviour).

If not, no worries, just wanted to see if you had an example available so we can dig into this quickly for you.

Speak soon!