Issue #1324💬 AnsweredOpened July 27, 2018by jvillena1 reactions

Remove attributes from a component

Quick answerby artf1

Read full answer below ↓

Question

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

Answers (3)

artfJuly 27, 2018
const attr = component.getAttributes();
delete attr.title;
component.setAttributes(attr);
alemencionesJune 22, 2019

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

lock[bot]June 25, 2020

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.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.