V0.17.25 . Trait button in the custom component defining.
Thanks @abolabo for the report, this issue was actually already fixed here #3735
Read full answer below βQuestion
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? FirefoxReproducible demo link https://jsfiddle.net/abolabo/3g7j519h/19/Describe the bug Code works incorrect: traits: [ { type: "button", text: "click me", full: true, command: (editor) => console.log("trait command"), }, ], I expecting <button> tag but input type=button shows instead. No text inside button. No command run.Code of Conduct[X] I agree to follow this project's Code of Conduct
Answers (2)
Thanks @abolabo for the report, this issue was actually already fixed here #3735
Thanks for reporting this, @abolabo. The issue with v0.17.25 . Trait button in the custom component defining. appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent state. What...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4466
Change in traits does not update html
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://jsfi...
Issue #6683
Modals close on mouseup event outside of modal rather than a full click
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 143.0.7499.169 Reproducible demo li...
Issue #4601
Update() of custom types added to StyleManager is no more triggered when switching between some targets.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chromium 104 Reproducible demo link https:...
Issue #3932
Trait add/remove can fail because collection type is inconsistent
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Brave Version 1.31.88 Chromium: 95.0.4638....
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
Introducing GJS.Market Services: ship your GrapesJS editor without the integration risk
It's everything that usually eats weeks of engineering time, scoped and priced up front. No open-ended hourly surprises.
Tutorial
GrapesJS custom components guide (2026)
Define custom GrapesJS components with DomComponents.addType: detection with isComponent, a model with traits and defaults, and a view for canvas behavior.
Tutorial
Building an AI-Assisted Document Engine with Next.js, GrapesJS, and the AI SDK
Transform your static template editor into an intelligent, generative design workspace with Vercel AI SDK, AI Elements and Next.js.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.