Can't run data provider functions onClick.

Hello, I’ve been using plasmic for three months, but since the last update where you introduced custom actions onClick, I’m now unable to run functions passed by a data provider when an user clicks a button.
I noticed that in case you wanna run custom code on click, you don’t have to write a function, but instead directly the code to be executed, so in case of a function passed by a data provider:


This created two main problems:
• For some reason, while in plasmic editor, the code is executed forever in a loop, even without clicking said button (can be avoided by checking if we are in the editor in the code component for the data provider, but still, why this code should be executed without a click?)
• The code must be edited manually (by adding () at the end to call the provided function) instead of just selecting the function from the data provider
Is this the intended behavior or am I doing something wrong?

In case this is a bug, you may probably wanna check if the provided code is a function, and execute it instead of wrapping the custom code inside another function like you are doing now

ah you are right that you need to call the function in a code expression, instead of just picking it from the data picker…

The execution loop is surprising though; @samuel can help take a look!

I can also show an example or send a video if you’d like.
Like if in the “Run code” option we write something like alert(“hello”) that doesnt spam the Studio editor. But if we use like a $ctx.provider function and we call it with () it keeps executing in the Studio editor (but not for example on the actual test page)

Sorry for that, this is a UI bug, the code editor is getting fixed to no longer spam