Skip to main content
iammai
Jun 22, 2023 2:21 PM UTC
Question

'Change to' with conditional action not working

When based on a conditional I want the component variant to change to another one (depending on the conditional), it doesn’t let me choose it to go to two different change-tos. If I change one of them, it changes the other one immediately.

I would upload image or video but I can’t as I am a new user. But basically to replicate this:

  1. Create 3 variants of a component (eg a number 1, 2, and 3 in a frame, and make them into component variants, let’s say the prop is either 1, 2, or 3)
  2. Create a variable (eg. next that is 3)
  3. From variant 2, create an on click interaction that has a conditional:

if (next == 3){
change to props = 3
}
else{
change to props = 1
}

What you will see is that when you create the second change to, it is automatically set to props = 3, and if you try to update the second one to props = 1, it will change the first one to props =1 as well.

This topic has been closed for replies.

66 replies

Ilona_Czerwinska
New Participant
Jun 29, 2023 9:03 AM UTC

Wow, @Terry_Burris the workaround works for me as well, thank you so much! 🙌

Michael_Persson
Jun 29, 2023 11:00 AM UTC

Hello,

I am trying to create a primitive “event listener” component state-based system as follows:

Variant 1 and Variant 2 loops in between each other with a “After delay” conditional to check a boolean state, which if true changes to Variant 3, which has a longer delay, and then sets the boolean to false and switches back to the Variant 1-2 loop. I have a button in the prototype bound to set the boolean to true. The purpose of this functionality is to handle toast visibility/animations in an easily reusable component that will continuously look for state changes in the boolean.

My intuition tells me that this should work, but Figma won’t let me select the variants in the Change to-action inside a conditional, even though they exist in the list and aren’t grayed or crossed out.

Does anyone know why?

Haroll
Figma Ambassador
Figma Ambassador
Jun 29, 2023 11:21 AM UTC

Hi @Michael_Persson

You’re not the only one experiencing this bug, it has been reported but not fixed yet tho’ Trouble with Figma's Conditional Interactions - 'Change To' Action - #9

Figma’s Forum Ambassador
Michael_Persson
Jun 29, 2023 11:48 AM UTC

Thanks. That is exactly the issue I am having.

Michael_Persson
Jun 29, 2023 11:51 AM UTC

The workaround “works” although without a way to evaluate and differentiate the else logic I struggle to imagine use cases for conditional actions 🫠

Hoping this gets patched soon!

Ellaine_Gabotero
Jul 4, 2023 8:19 AM UTC

image

Is this how you see it on your end?

Best,
Greg_Saxton
New Member
Jul 7, 2023 3:24 AM UTC

Yeah @Terry_Burris I am having the same issue. So frustrating!

Prameshwar_Kumar
Jul 7, 2023 11:07 AM UTC

I feel there is bug with conditional variant interaction. I am having a Boolean variant which i am trying to set with conditional“If something true change this Boolean value to true else change to false ” But when i am changing in “else” the same reflecting to if condition as well . Hope many of them same issue.

Katelyn_Barth
New Member
Jul 13, 2023 11:34 PM UTC

I’m also having a difficult time with this. Not only is it hard to change the interactions, but it makes interactions with multiple conditionals really hard to read.

Ryan_52
Figmate
Technical Quality Specialist
Jul 18, 2023 7:04 PM UTC

Hi @iammai thank you for reporting this to us, I have passed this along to our engineering team.