Skip to main content
vernikr
New Participant
January 27, 2024
Question

Bug when switching variable modes in nested components

  • January 27, 2024
  • 52 replies
  • 4120 views

I’m trying to switch a variant of component instance by switching variable mode. This works perfect once the component A is on top level and not nested.

But if I nest component A into component B and then change the variable, the instance of component A still changes the variant as supposed but this also resets all other other properties of comp A to their defaults.

This doesn’t happen when comp A is not nested.

Tried with several components even with the simplest created from scratch.

This topic doesn’t relate to prototypes and interactivity.

This topic has been closed for replies.

52 replies

Alexey_Kolesnikov
May 22, 2024

It looks like an error in the assignment of variables, in my file the text is switched automatically, because its size is embedded in the token, and the token is not connected to propertes, but to numeric values (height, text size, etc.).

Alexey_Kolesnikov
May 29, 2024

Good afternoon, can you tell me when the problem will be solved? Many people are waiting for this bug to be fixed

May 30, 2024

Having a related issue with modes and variables, if a nested component is set to a different mode to the parent component then the variable doesn’t change when clicking on interactions (eg. I have a counter that should go up by 1 every time I click a button but the counter stays at 0)

Switching the nested component to ‘auto’ or manually setting it to the same mode fixes this.

Took me ages to figure out what was wrong as I had mass set the mode on a bunch of screens yesterday and didn’t think there would be a connection to the issue.

May 30, 2024

Hi @Alexey_Kolesnikov, I’ve also had this issue and found the command (CMD+/) “Regenerate all instances” can sometimes help fix disappearing content without having to unlink the variable from the prop.

Alexey_Kolesnikov
May 30, 2024

Thank you, it really is faster

Jimmy_Frogbat
June 6, 2024

I have a component with 2 different nested components (a logo and a currency symbol).

The nested components have 3 variants each. Which variant is shown is determined by a variable mode.

When the parent component is placed on another file, the nested variants disappear till they are clicked on or I use the regenerate.

This occurs whether the parent component is placed directly into a file or if itself is a child component.

The components’ instances in the parent file behave as expected.

Thanks.

Mario_Santos2
New Member
June 17, 2024

I have the same issue, the nested variables for the component variations do not sow when I change them in the instance.

It shows only the “default” variable obtains of the core component variant

Sam_Woo_Staar
New Participant
June 25, 2024

I have been having a similar problem.
We have created modes for “tvOS” and “CD”.

We also created a text string to swap components based on mode and applied it to our button component.

The modes swap components and overrides perfectly when in a standalone frame, but breaks down when the same setup is applied to a component.

Jacob_Kersh
June 28, 2024

I also have this issue.

Lisa_Morellini
June 29, 2024

I’m also having this issue.
I have a ‘wireframe’ layout for a component, and then a more detailed ‘mockup’ version with text and images within it. The goal is that I can wireframe a layout, and quickly, when needed, swap to a mockup.
Using a boolean variable seems to work for a few components, but then after applying it to a few components and testing, eventually I start getting blank components, making it appear as if it’s just disappeared when I change the mode of a block.
Then, as I scroll around my file, the others I previously swapped fine, start to disappear as well.
It feels to me like it’s an issue with loading/memory usage.