You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a strange behavior, I can add all the attributes I want when adding component directly inside canvas using dom components add function (like code below) but the editor always remove the class.
let component = editor.DomComponents.addComponent({
tagName: 'div',
content: 'Content text', // Text inside component
style: {
width: "100%",
height: "100px",
"background-color": "#ddd",
color: 'red'
},
attributes: {
title: 'divTitle', // This works
id: "divID", // This works
class: "someClass" // This is going to be removed
}
});
The class is only added if we create the component first and then assign a class to it. Example, we add the code above and then we add the code below:
Yeah, you have to use classes property, but I agree that is confusing (that because classes are treated a bit differently), so I'll try to make the initialization possible also with attributes.class value
GrapesJS Version used: 0.16.12 (current)
Just a strange behavior, I can add all the attributes I want when adding component directly inside canvas using dom components add function (like code below) but the editor always remove the class.
The class is only added if we create the component first and then assign a class to it. Example, we add the code above and then we add the code below:
The text was updated successfully, but these errors were encountered: