[BUG] Custom Component Class is not being rendered unless trait changes
I think this is a bug,
Basically, I have a custom component that has an attribute of a class ('gjs-button'), but that class only appears to get rendered/applied when a trait is changed.
-
Drag and drop the component:
-
Amend the component Trait.
-
The component is rendered again, but now you can see the class 'gjs-button' has been applied.
I've created an example: https://jsfiddle.net/tb2gyas8/3/
Is that a bug? Or is there something wrong messing up the component?
Thanks Adam
Appears a similar thing happens on save and reload. With this custom component, you are allowed to amend the size, but when you save and reload, the renderer doesn't draw it to the correct size, even though it has saved the correct width:
Before Save:
On Reload (It has the correct width):
]
If I then change the trait, it will then default back to its original settings (AKA losing the width).
Hi @adamwpe please use classes attribute instead of attributes:
//...
resizable: true,
editable: true,
hoverable: true,
classes:['btn','gjs-button'],
//...
Cheers!
Oh Thanks, @pouyamiralayi,
Seen someone used attributes and assume that was the correct method - worked like a charm!