GH5T
3
@dorilama is correct. You need to learn the fundamentals before jumping in. Bubble has its own context, and syntax, sure, but it still follows the same principals.
Anytime you use the update function and have properties, when the page loads, it fires once, when a property has changed (even on page load because it’s changing from default to filled), it fires again.
You’ll need to setup initialization flags to assure it won’t fire more than needed.
For data referencing, like @dorilama had said, you can setup instance.<data> or instance.data.whatever. With “canvas” it’s just a div element. You can modify the element like any other HTML.
With initialize you create the initial element properties (defaults), and with update you change that element.
You can refer to the canvas or you can create your own element inside the initialize, set that element to instance.data.element and then refer to that element on the update function.
2 Likes