Skip to main content
Solved

Variables + Components with variants doesn't work


Robert_Powers1

Steps to replicate.

  1. Make a string variable tt with the value of “Target Text”
  2. Add a text input to your stage and bind the tt variable to the text field.
  3. Create a component with two radio options A & B
  4. Make variants for each with selected states and create OnTap Changeto action + actions to set the variable field to A or B.
  5. Drag in a variant of the radio components.
  6. Test prototype

Expected results

  1. The text variable changes to A or B
  2. The selected state changes between variants

Actual Results

  1. The state changes but the string variable does not update.

Best answer by Robert_Powers1

OK. I started a new file and for some reason is was something buggy in the file.
It’s working in the new one…Thanks.

One thing to also note is that I think the bug was occurring because the radios were made from component sets that were made from components and it was causing some confusion in Figma. You have to break all connections to the component.

View original
This topic has been closed for comments

10 replies

  • 1 reply
  • June 27, 2023

I’ve got the same issue. Would love a fix for this asap!


tank666
  • 4863 replies
  • June 27, 2023

Robert_Powers1

That still doesn’t work.


tank666
  • 4863 replies
  • June 27, 2023

I just recreated your example, reordered the actions so that “Change to” is the last one in the list of actions, and everything works as expected.


Robert_Powers1

Please publish and share your file.
I’d love to see how you have it assembled.


tank666
  • 4863 replies
  • June 27, 2023

Everything can be seen in this screenshot:


Robert_Powers1

Weird. I rebuilt my completely and it still has issues. Only the first action triggers.
Also how do you get the little variable links to display in the canvas? They don’t display in mine.

This
image


tank666
  • 4863 replies
  • June 27, 2023

Are you sure you reordered the actions? Take a close look at the interaction modal windows in my screenshot. As soon as the first action in the action list is “Set variable”, you will see the corresponding icon on the canvas when the Prototype panel is open.


Robert_Powers1

OK. I started a new file and for some reason is was something buggy in the file.
It’s working in the new one…Thanks.

One thing to also note is that I think the bug was occurring because the radios were made from component sets that were made from components and it was causing some confusion in Figma. You have to break all connections to the component.


  • 0 replies
  • July 27, 2023

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


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