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:
$ctx.otpProvider.onRequestAnotherCode()
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