Warning "this interaction must swap from a variant to another variant within the same component set

This topic was already mentioned in an older post, but the solution did not work for me and it seems like it also didn’t for another user. (the post: Getting warning “This interaction must swap from a variant to another variant within the same component set” - Not sure what it means

I essentially have the same problem.

However, I checked and the variants ARE within the same component. I even renamed the component on another page to avoid confusion, yet it still doesn’t work.

This is incredibly urgent, please help me.

This is the instance with which I’m struggling and for which the warning comes up. posting in a comment cause I wasn’t allowed to attach more images.

Another screenshot, in case it helps

I managed to circumvent the issue by adding the interaction to the component itself and not the instance. However, I would love to know if there is another way of doing this without re-typing every interaction.

The only way Change to interaction could be used is inside the variant set, not in instances outside.

I believe you can copy-paste prototyping actions so you may be able to use that instead of retyping.

I don’t think that’s the issue. I am trying to switch between variant a of component x and variant b of component x. They are variant sets of the same component.
And the copy-pasting doesn’t work cause Figma still seems to think I am linking to a variant outside of the component. If I delete the conditional and retype it in the exact same way then it suddenly works.

It’s hard to explain, it’s like copy-pasting the interaction creates a ghost component that the interaction links to and it doesn’t recognize that the change to is actually to a variant of the linked component, not the ghost component. Does that make sense? Probably not.

Still, the only way this has worked for me is moving the interaction from the instance to the component. Mind you, interactions on the instance of the component instead of the component itself worked in every other case for me (about 15 other times), but I’ve started to move the interactions to the components for all of them, just to avoid this issue in the future.

Thanks for taking your time to reply, but I’m not sure it solves the issue. Thank you very much anyways, I really appreciate it :slight_smile:

It’s not really a solution, more like I’m trying to explain how this works. To clarify the terminology: a variant set is a collection of variant components like this:

A Change to interaction can only be created inside of this variant set. So when you are talking about instances, that’s outside of the variant set, no matter what these instances belong to.

It would indeed be nice to create such interactions in the future but currently it’s simply not possible. This is the technical limitation. Feel free to create a feature suggestion in the Share an idea category so other people can vote for it. This is the only solution currently.

Oooh okay, sorry, I misunderstood you before. It’s kinda weird though that it works sometimes but other times doesn’t? I find it strange that Figma would allow me to create functional change to interactions on instances and at some point suddenly tell me they don’t work anymore.

Anyways, thanks for taking the time to explain this to me, I’m fairly new to Figma, so it was very helpful!