Skip to main content
Shane
February 26, 2021

LAUNCHED: State management for prototypes

  • February 26, 2021
  • 205 replies
  • 21529 views

Just struck a pretty simple use case/scenario where I need the component to reset it’s state when I leave the frame. This has been touched on elsewhere, but this is such a common and key use that I thought I’d put it in it’s own thread.

Scenario:
I’ve got a dropdown menu with three items in it, with each item changing what columns are visible in a table and some other control states. I have three frames, each with a view of the table setup as it should be, and want to use the dropdown items to navigate between the frames - basically faking the table state change. All of this works perfectly, however when I navigate back to a previous table view state, the dropdown component is already in it’s open state - not what I want.

Current workaround: none that I can come up with (other than not using interactive components at all for this, and just using multiple frames for the dropdown open/closed states as I would previously)

Suggestions:

  1. Have a “reset component on leaving this frame” setting for instances of a component on a frame - useful for this situation and others, but needs to be a setting so that components that should keep their state between frames can do so (light/dark toggle maybe? Something like that).
  2. Do it all in a single frame, with the dropdown component changing the the state of the table component - no frame navigation required. Would work nicely for the particular use case I’m working with here, but not sure it would solve all similar situations.
  3. Do both 1 and 2. This solution is my preferred solution 😉 😆

EDIT:
Other threads that relate:

205 replies

Giuseppe_C
October 15, 2022

Adding my +1 to the choir, this feature seems to be pretty fundamental when dealing with interactive components

yoann2
October 18, 2022

No news from the team on this one? Really needing this 🙂

filip7
October 20, 2022

+1

Fix this please.

Zachary_Foster
October 24, 2022

Running into the same issue…makes it waaaaay hard to use interactive components when there isn’t a way to ‘refresh’ their state or have a reference marker tied to a frame.

Karl_Kipper
November 3, 2022

+1, its been a year soon…

Sam_Rousseau
November 3, 2022

+1 - has anyone figured out a work-around for this? I have a selected state on my components, but only one thing in the prototype can be selected at once. I think I have to override it and do it frame by frame, but that’s a much more complicated prototype.

nikitin
November 3, 2022

+1
This bug is a very disappointing 🥲

dennsi
Active Member
November 4, 2022

+1 Frustrating

Mike_P
November 4, 2022

Same problem… Where is the answer? I used to use Proto.io and they just gave you multiple actions upon click… you could navigate to another frame and change the state of the navigation component. Why is this tens of billions of dollars company not able to do something so remedial?

Barry_Lachapelle1
November 8, 2022

oooof this is a killer - just ran into this. I want a component to go to the default state when I close an overlay. That should be a pretty common use case I would think.