Mode swap in prototype not working

Hello, community.

Is anyone else having this issue with the new mode swap for variables:

Basically, the mode swap for variants works when I use the layer dropdown in the design mode. The variable is assigned

However, when I apply the onClick event to swap the modes in the prototype, nothing happens. The click function is there, the swap mode function is assigned, and the right variable collection and variable modes are assigned.

I even tested it with something as simple as an empty frame with a rectangle to click. Still nothing.

EXPECTED - works with the old method

Hi @OG_Can, Thank you for reaching out about changing the variable mode with an interaction. I understand it might seem a bit buggy.

However, I’ve done some testing on my end, and everything appears to be working as expected.

Could you please double-check if the modes for the related objects are set to Auto?
Here are related articles you can check more details:

​​Also, could you confirm whether this issue is occurring on the desktop app or the website, or if it’s happening on both platforms?

If you’re still facing difficulties, I suggest reaching out to our support team directly for further assistance : https://help.figma.com/hc/en-us/requests/new
When contacting our support team, please provide the following:

  1. The email address associated with your Figma account
  2. The direct link to the file experiencing this issue, and please add support-share@figma.com as an Editor to the file (note that this won’t impact your billing).
  3. A brief video recording of the issue, along with an explanation.

I hope this helps a bit. Please let us know if there’s anything I may have missed.
Additionally, if anyone from our community has further insights or suggestions, please feel free to share them here.

Thanks,

@Junko3 Thank you for your answer. You have resolved my issue.

One more question:

Is it possible to assign multiple mode swap functions (e.g., tap to switch to mobile mode, tap to switch to desktop mode to the same button)

At the moment, I am doing this with two buttons with separate functionality and Boolean show/hide

Hi, Great to hear that you’ve resolved the issue!

If you’re considering using multiple actions, remember that they will execute in the order they’re listed, from top to bottom.

I did a test on my side using the “Set variable mode” for multiple actions as below. From what I observed, I could only see Mode1 when clicking and I didn’t see the transition from Mode 2 to Mode 1 in my preview, and there are no options to set the duration for this.
Screenshot 2024-05-16 at 13.42.25

It really depends on what you’re aiming to achieve with your design, but I’m concerned it might not work exactly as you expect.

Hope it helps!