Variables + Components with variants doesn't work

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.

7 Likes

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

That still doesn’t work.

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.

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

Everything can be seen in this screenshot:

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

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.

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.

1 Like

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