Bug using variables to switch variants in nested components

After the recent introduction of nested variables in components I tried to use string variables to change the state of primitive components. In this case the example is a table of contents where once one item is selected the others should be deselected.

The problem is that by assigning variables to nested items inside the parent component, Figma loses the change made to the text label.

As you can see from the example, the problem only applies when applying a variable to a variant in a nested component, while in the one outside nesting the problem does not occur even if the string variable is linked to the variant.

Do you have any solutions for this?

Anyone know how to solve or any walkaround other than detaching the main component?

Hi @Francesco_Fagioli2, Thanks for flagging this issue and providing the screen recording. I understand how you feel when something doesn’t work as expected.

It seems that the issue here is the instance loses overrides (Lorem ipsum 1) when changing variants, as shown in the screenshot below.

There have been similar reports on the Forum recently. Our product team is already aware of this issue and is actively working on addressing it.
Here are some related posts for you to check out:

While we have tested on our end and cannot replicate the issue currently, you may try restarting Figma to see if your file has received the fix.

  • Browser: Force-quit and open Figma in a new browser window.
  • Desktop App: Force-quit the Figma Desktop app and restart it.

However, please understand that these fixing processes can take some time.
If the issue persists after a while, please share a direct link to this file where this issue can be confirmed. This way, our community can delve into your prototype.

Thanks for your patience in the meantime!
Also, we welcome insight from other community members for the workaround here, other than detaching the instance.

Thanks,

2 posts were split to a new topic: Switch variants in nested components bug