I have a list of lets say 1000 products showing on a page, when you click the product it then takes you to a product-detail page.
Here is where the fun begins, when I need to exit the product-detail page I want it to return to the exact position in the list that the product was clicked (when it went to product-detail).
The issue is mainly on mobile. When you go back then it starts from the top of the data. So as you can image if you have scrolled through a few products is a pain to start from the top again.
Essentially what I need to do is when I go back scroll to the product ID automatically.
Not near a computer but hopefully this should work.
On the products page give each product within the repeat a unique id using dmx-bind I.e. something like ‘product_’+product_id
The in the product detail page point the return link to that anchor I.e. products#product_xxx
That should cause the page to scroll automatically to that anchor.
This is why I suggest just a plain and simple link to a new page in a blank window. Two fold benefit is the initial page remains open at the position the User left, and the product gets full SEO. We too explored all types of ways of jumping back to a position within a results set but it was all too much of a mess. Worked well in some situations on some devices and browsers but not so well in other browsers or devices, so went with the link instead, rather than waste too much time on it.
well that’s bloody annoying lol…it seems if I just add browser>back then it goes back to the same place. I’ve tried it on mobile, tablet and computer in multiple bowsers and it works no issues…!
Can you explain this again? I suspect you’ve uncovered a bug - hitting the browser’s back button should’ve rendered the same result as the Browser component Back action
If the situation matches what I described (different behavior) a bug report should be opened to maintain consistent behavior (which is obviously your intended one)