Skip to main content
Question

How to reset the scrolling position within a frame after swapping instances with variables?

  • April 9, 2024
  • 2 replies
  • 352 views

Jeremy_Hesidenz

Hello. I have a frame which contains an instance of a component variant. The component has several variants, all of differing height.

When clicking one of three buttons above the frame (tabs) I use variables to switch the variant that appears within the frame. The issue I am encountering is that the variant inside the frame is preserving the scroll position of the previous variant, and I want the variant to always start at the top when it is swapped.

For example, in the GIF attached, variant #3 of my component in very long. I scroll to the bottom of the frame, then switch back to variant #2 which is much shorter.

At this point, the frame still thinks that it is scrolled to the bottom of variant #3, showing only white space because variant #2 is scrolled far beyond its actual length.

When attempting to scroll variant #2 after this, it “snaps” back into place because it realizes that the height of variant #2 is far shorter than the current scrolled position.

How can I fix this?

Figma_ONqkDFG893

This topic has been closed for replies.

2 replies

Jeremy_Hesidenz


Anita2
  • 1 reply
  • May 28, 2024

Hello, did you end up solving this? I have the same problem!