Can't able to remove the added traits properties[QUESTION]
Hi there! provide an id for your trait and try again based on this: `this.removeTrait('trait-id');` cheers!
Read full answer below ↓Question
Hi, I can able to add the traits properties dynamically by using the following code. but the following code to remove the type name is not working this.get('traits').remove('type'); my complete traits are can anyone please help me
Answers (2)
Hi there! provide an id for your trait and try again based on this:
this.removeTrait('trait-id');
cheers!
Use addTrait and removeTrait methods
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3237
Add Trait For wrapper
Hi @artf I've added trait for wrapper this way. How can I perform the init function for the same Here is the code @artf Could you please he...
Issue #2819
[Question] I am updating trait using addTrait function? It updates and adds the trait in trait manager but unable to reflect it in html section of codeManager?
I have written the following code - const component = editor.getSelected(); component.addTrait({ name: 'traitName', type: 'text', label: 't...
Issue #3228
Component Value is not changing
Hi @artf I've added a new component here is the code on selecting the h1 and h2 tag it's changing the value in the HTML section as you can...
Issue #975
[Question] Default values for traits field
I have created component with certain traits. I am not able to assign default value to traits by passing values. It is coming as undefined...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Tutorial
GrapesJS vs Webflow vs Tilda (2026): Honest Comparison, Pricing & Which to Pick
GrapesJS vs Webflow vs Tilda compared head-to-head: real 2026 pricing, SEO features, code export, and which one actually fits your project
Tutorial
Integrating GrapesJS into a Vue 3 App — Complete Guide for 2026
Build a Vue 3 landing page builder with GrapesJS and Vite. Custom blocks, composables, remote storage, TypeScript & production tips. Updated for 2026.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.