Skip to main content
Shane
Feb 26, 2021 6:30 PM UTC

LAUNCHED: State management for prototypes

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

Jenny_Lai
Jan 19, 2022 1:22 PM UTC

Would be very useful to be able to set/change property states based on a trigger (ex: load screen).

Laura_Franca
Jan 25, 2022 3:13 PM UTC

Hi guys, what I did - and worked (not perfectly, but it did got the effect I wanted) is to put the option “mouse leave” on the open component linking to the closed one.

Another suggestion to Figma devs would be to be able to make two results with the same action. Ex: on click > nav to x page AND change component to Y

Laura_Franca
Jan 25, 2022 3:15 PM UTC

Hi guys, what I did - and worked (not perfectly, but it did got the effect I wanted) is to put the option “mouse leave” on the open component linking to the closed one.

Another suggestion to Figma devs would be to be able to make two results with the same action. Ex: on click > nav to x page AND change component to Y

Tsvetan_Kolev
Jan 25, 2022 11:01 PM UTC

Ok. I just don’t get it. This is something very important. It’s a major bug that ruins the whole point of interactive components and @anon21722796 haven’t paid any attention to all people complaining for almost a year.
Meanwhile we are all losing valuable time to seek for work-arounds instead of working on our projects.

Steven7
Jan 27, 2022 11:56 AM UTC

I personally think this is a massive road block to using interactive components “interactively”. If you can’t have a select that switches between a default/active/interactive state in an overlay modal that when the modal closes the states reset to default then what’s the point.

For me this shows just how behind Figma is on the prototyping front compared to the complexity that ProtoPie and ProtoIO deliver.

taylor1
Jan 27, 2022 3:16 PM UTC

Same here @anon21722796 this is super painful. This almost defeats the purpose of interactive components.

Aleksandr5
Jan 29, 2022 1:28 PM UTC

Ehh…

Just a small +1

Berlinguette_David
New Participant
Feb 1, 2022 7:36 PM UTC

Plus 1. This seems like a huge miss with a fairly simple solution.

Cagdas_Kara
New Participant
Feb 11, 2022 10:16 AM UTC

Hello everyone.

I have a question with interactive components. I don’t want to keep interactive status. I want to reset my component variant status. For example I have switch toggles. I click to on my switch and I am going to other pages, and then I am going to this screen, my switch still active. I don’t want to this. I want to reset status. Is this possible?

I have a video below 👇

Cameron_Gibson
Feb 16, 2022 9:03 AM UTC

Guessing no update on this yet? Would be great to sort this