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

YSluimer
July 17, 2024

We have somewhat the same issue. We’ve setup the component with a viewport token to determine which variant it should use. We then input the correct into the instance and drag it to the mobile frame. As soon as it’s dragged into the mobile frame it resets all the content to the base content of the component.

The result:

y_toku
Figmate
Community Support
July 19, 2024

Probably our support team needs investigate with your file access. Could you submit a bug report detailing the steps that led to this issue? You can do so by following the link:

Figma Learn - Help Center

Thanks for your understanding.
Toku

Sean_Cooley
New Participant
July 23, 2024

Having the same issue. Have to run “Regenerate All Instances (Slow)” on a regular basis to get nested variants to show again after changing a variable mode. We are using it to manage brands and switching the logos and icons used. The instances dissapear on a regular basis when changing the mode.

I’ll have to document this for my team, but definitely not the behavior I would expect. Seems like a bug to me. Is the team aware?

Sean_Cooley
New Participant
July 23, 2024

Found a fun tidbit hidden in the prototyping section of variables:

A nested instance does not transfer overrides if its variant is changed due to an attached variable changing values.

So you can’t apply overrides to anything you plan on switching with variables. I had to end up baking the overrides as variants of the component itself.

It seems odd that Figma buried this info, and that the default behavior of variables is very different from manually changing a variant instance.

Figma Learn - Help Center
bogdanovjn
New Member
July 25, 2024

Same problem with deeply nested instances when switching modes, but without any variables.

Video

Fred_Tinsel
Active Member
August 7, 2024

Hello.
Same here, and it’s really annoying in a design system used by others designers…
Off course, they are complaining!

Edit —
I tried to use Text string and Numbers as variables… the same reset happens.

Lee_Hayward
New Participant
August 7, 2024

I’m having same issue of icons with variables assigned disappearing on theme switch.

Dario1
New Participant
August 8, 2024

Same issue for my Team.

Sanny
New Participant
August 9, 2024

Same issue here:

Figma’s reply:

This is a known limitation of variants nested in other variants. I’ve gone ahead and added your details to the report so they can continue tracking impact.

I’m also going to forward this to our product development team for review. While we can’t guarantee implementation, please know that your feedback is highly valued and will be taken into consideration for future updates. You can check out our Releases to stay up to date on all of our major product news.

What’s the purpose of component-based design systems if the components fail to work?
I think debugging this one needs to be the main focus for the Figma dev team. Who cares about AI, new UI, and Figma slides releases if the core of your main product is buggy?
Sorry, just a little bit fed up with this one.

Marino_Panariello1
September 10, 2024

Same problem here, someone found a workaround?