Maintain scroll position after click

I’m trying to maintain scroll position after click in a simple prototype I’m working on. The option was moved from the inspector (not sure when - somewhat recently). I see it in the menu but it’s greyed out. I can’t enable it.

I have an older file (from Feb 2024) set up the exact same way as my new file (minus stacks) but the behaviour with regards to this feature is different. Am I missing something in terms of scroll behaviour since stacks were introduced? How can I set up my prototype so that I’m maintaining scroll position after click?

Hi Nico. :waving_hand:

The option to Maintain scroll position after click has not been moved from the Inspector, but I think I know what’s happening in your case, by your mention of Stacks.

A bit of history first: This option was first implemented in Sketch a vey long time ago, before we implemented Overlays. At the time, it was used to basically emulate showing an Overlay, but it was not ideal, as you had to design an entire Artboard, duplicate it, and then dummy up a fake Overlay on top of that second Artboard. So when you scrolled down the first Artboard, you could click a button to show the fake Overlay, but you were actually moving to an entirely different Artboard.
It was not an ideal way of doing things, especially if you needed to make edits, which you would then need to do twice.

So fast forward a bit to some point after this, where we introduced proper Overlays. Now you could just point to the Overlay from your one single Artboard, and it would appear in place, directly on top. There was no navigating away to a second Artboard, and accordingly, no need to maintain any previous scroll position.
However, for legacy reasons, we kept this option for any existing pre-Overlay designs. And it remains in place to this day for that reason.

Now fast forward even more, and we have changed Artboards to Frames, which brought another change in that we can now nest Frames within Frames, something we could not do with Artboards.
But the old legacy of being able to set Maintain scroll position after click is still tied to what was an Artboard, which is now a Canvas-level Frame. If you apply an Interaction to a layer directly on a Canvas-level Frame, you’ll see that this checkbox is still there. But it won’t show for any Interactions set up inside of a nested-Frame however, because this is not the equivalent of an Artboard. And if you have a Stack placed on your Frame, then that Stack is actually a Frame in its own right, so it is considered a nested Frame now. Therefore, any layers inside of this will not show the checkbox.

Apologies for going on a bit, but hopefully that explanation helps explain where this feature does exist, and where it can and can not be expected to be found.

What I am curious to know more about though is why you are wanting to use the old legacy checkbox in a new document? If there’s a reason for still using it (inside of a nested Frame) that we are missing, then I’d love to hear more.
Please let us know, thanks. :folded_hands:

3 Likes

Thank you so much for the detailed explanation. I think I relied on the old functionality mostly because I’ve always had to work quickly, it easily communicated what I was looking for, and it did what I needed it to do for my prototyping work. It makes sense that this was/is being depcrecated as functionality improves. I’m not looking to see it come back, I just needed a solution in the moment and the old one is all I knew. I need to spend more time learning how to make things work with stacks (which I love, huge game changer in terms of saving me time :slightly_smiling_face:).

1 Like