grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Remove attributes from a component

Open jvillena opened this issue 8 years ago • 3 comments

Hi @artf I don't know if it is possible to remove an attribute from a component. In our project I'm injecting a custom attribute from a custom trait that I created but there is an option to unselect this attribute so I would like to remove from the component.

I couldn't find the functionality on your code.

Thanks in advance

jvillena avatar Jul 27 '18 14:07 jvillena

const attr = component.getAttributes();
delete attr.title;
component.setAttributes(attr);

artf avatar Jul 27 '18 19:07 artf

@artf hi man!, can you say me some alternative to remove attributes?

alemenciones avatar Jun 21 '19 22:06 alemenciones

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jun 24 '20 21:06 lock[bot]