Skip to main content
Question

2 level of component nesting breaks instance swap, or property state in prototype

  • February 17, 2025
  • 1 reply
  • 38 views

Corey_O_Brien

We are trying to use a component that has a nested sub-component.  That sub-component then also has a nested component.  When we start the prototype with all of the parent items expanded, it works great.  When we collapse each, and then expand them again, the sub-components all work as intended as well as the sub-sub component.  If we start the prototype with the parent collapsed, it breaks and reverts all of the sub-sub components back to the first variant.  Here are pictures of an example we built as well as a prototype link for it in action.

 

There are two prototypes, one with them expanded.  If you click on the expanded items, they will expand and collapse and keep the rest of the content, the green/yellow blocks the same plus the text within them.  On the other, incorrect, one, if you expand them the colored boxes does stay changed, but the text reverts back to just “Testing Block”.

 

Thoughts on how to fix this? 

 

 

 

1 reply

Corey_O_Brien
  • Author
  • Active Member
  • 56 replies
  • February 18, 2025

We found a solution.  We were able to make this work by making both variants, the collapsed and the expanded have the same elements inside of it.  So essentially, the collapsed state variant needs to also contain the nested component for it to remember the state.

 

This seems like a bug.  If we start with the expanded variant, it remembers the state even when we switch to the collapsed state (even when the nested component isn’t there), but when we start with the collapsed state, it doesn’t.  This is a bad thing because this means that for every one of our components that do this, we will have to include a bunch of hidden layers/nested components, in order to save the state.

 

Hopefully, this helps someone, but also, this seems like a bug that should be fixed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings