Skip to main content
Michael_Persson
Nov 21, 2023 9:31 AM UTC

Variable change listener interaction

Hello!

As mentioned earlier in posts such as Prototype - Interactions - Event listener & ElseIF conditional, it would be really useful to have interactions trigger from variable changes.

Right now, you can already accomplish these by combining conditional statements with the “After delay” interaction, but it is extremely tedious to maintain and demands a lot of janky component work (see example of implementation in video).

Simply having “Listen for change in variable X” as an interaction would be a really powerful tool to create reusable components for advanced prototypes.

13 replies

y_toku
Figmate
Community Support
Nov 22, 2023 7:46 AM UTC

Hi there,

Thank you for providing feedback! I will share this with our internal team. Your input is highly valued, and we will take it into consideration for future enhancements.

Thanks,

Toku

Havard_Hammerstrom
New Member
Nov 22, 2023 10:05 AM UTC

I made a post about this some time ago, but I completely agree. I have also solved this by creating “After delay” components that run constantly. My project is very large, and this results in it being very CPU intensive, and the prototype interaction lag as a result. “Listen for change in variable X” might not be enough, because you might need to listen to several variables. So, it would be better to listen for any change, in any variable. “Listen for change in variables” would solve my needs at least. Aka, OnEvent/EventUpdate.

It is also very tedious not being able to copy and paste elements within an event.

y_toku
Figmate
Community Support
Nov 24, 2023 3:26 AM UTC

Thank you all for the feedback! I passed them along to our internal team. We really appreciate your voice!

Guzman_Iglesias2
Mar 21, 2024 8:50 PM UTC

I support this idea. It would be great to have it.

Apr 23, 2024 11:05 PM UTC

I think what you are trying to achieve here is similar to this other post Change variant of a component from a different component If so, there is an answer inside this post.

Michael_Persson
May 14, 2024 1:11 PM UTC

Hello,

No, I don’t think this is the same functionality. Binding a variable change to an action is not the same thing as binding a variable change to an event.

Jun 25, 2024 12:53 PM UTC

I need this too very much!

Dylan_Davis
Aug 1, 2024 5:03 AM UTC

i faked a listener using the hover state on the frame but this does not trigger when deployed onto mobile 😦

Aug 26, 2024 3:08 PM UTC

It is interesting how little this is voted on. It’s one of those things that most designers wouldn’t think to want or know about and are probably okay with recreating the same prototype conditions over and over to each action, while devs have it drilled in their head to keep things DRY and have a concept of listeners so that we only have to write the listener conditions on the targeted element (e.g. undisable the submit button when checkbox 1, 2, and 3 are checked). As both a designer and dev like a lot in the comment probably are, this is hurting my soul, and I think it’d hurt designer souls too once they understand how much cleaner and less tedious this could be (wouldn’t take much, imo).

I think a listener system would be amazing!

Koen_van_Niekerk2
New Participant
Dec 30, 2024 8:56 PM UTC

Great Idea!

I posted something similar. “Driven” variables are updated once a property changes in your design OR prototype (e.g. a width of a window changes). This can be used with conditionals that respond to changes in these “driven” variables to drive things like replacing a desktop nav with a mobile nav (or many other things)