How to return to the scroll position of the previous group/rg when closing the current full page group?

Hi everyone, I got a really annoying UI situation going on and was hoping someone here knew an easy fix. I have a page with a list of repeating groups that open up a full-page group when selected. The problem is that anytime a user closes the group they return to the top of the page rather than the position they were in when they clicked to open the group. This becomes a real hassle since users have to scroll down again all the way to where they last were to continue to browse.

Is there an easy way to make sure that they return to where they were before they clicked to open the full-page group? This is all a single page so I can’t use URL parameters I believe… so would I have to use states to save the scroll position? I feel like I’m missing something obvious since this is a basic behavior you would expect from an app…

Any tips or guidance would be much appreciated!

Cheers from a confused bubbler

Hi there, @arsenewenger… I have done exactly what you described in one of my apps, and I did it exactly as you suggested by using custom states to save the scroll position when a user “leaves” the different groups. Then, when a user returns to a group, I use the Toolbox plugin to run this javascript… window.scrollTo(0,group’s associated custom state);

If you haven’t gone down that path, I recommend it because it works like a charm for me. I ended up using custom events to set the scroll position and do the auto scrolling when returning to a group, and again, it works great.

If you head down this path and get stuck, post some screenshots of what you have, and I’m sure I (or someone else) will be able to help.


1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.