Skip to main content
Shane
February 26, 2021

LAUNCHED: State management for prototypes

  • February 26, 2021
  • 205 replies
  • 21530 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

Sanny
New Participant
December 8, 2022

+1 for default state after navigating

Sanny
New Participant
December 8, 2022

+1 for this feature!!!

Court_Crawford
December 13, 2022

+1 for preserving state, but in my case even within an existing frame. Imagine creating a tic-tac-toe board where each cell can be an X, or blank. Once the user clicks on a blank cell and converts it to an X, I also want to navigate to another frame which, after a brief interaction, returns to the frame with the tic-tac-toe board; On returning to the board, I want what just became an X to remain an X and not be a blank again.

Ayoub_El_omri
December 14, 2022

Run into it now. I have a fairly simple setup with a nav menu in the home that can be opened to navigate to deeper routes. Every time I open it and navigate to another page the component will remain open after navigating back to the page.

Piotr_Kocybik
December 20, 2022

I found myself in the same situation, unable to reset a component on interaction.

Lucy_Spence1
December 28, 2022

Similar issue here. Second time an event happens, it hides/rearranges components in a menu system for no apparent reason, and doesn’t reset

Nikita_Chikate
December 28, 2022

resetting component

Francesco_Gramegna
January 3, 2023

+1 For this! 🙏

Marijn
New Member
January 20, 2023

+1 for me.

Diego_Gonzalez_Salcedo1
New Member
January 24, 2023

same here 😪