Text components don't behave correctly after creating custom components
You're mixing the old API with the new one for the custom component definition. With model: defaultModel.extend({ was required an inner static isComponent (you're using one outside, like in the new API) and without it, you're breaking the Component Type Stack You should just change model: defaultModel.extend({...}) to...
Read full answer below ↓Question
Hi artf, After creating custom components, the text component does not behave like before. It removes all the naked nodes after changing some code in import modal. e.g After editing something in import modal it gets change to: As you can see it removed the Naked text node i.e Insert your text. It should be noted that this behavior doesnt happen when there is no custom component added to the editor. An example of custom component that i created:
Answers (2)
You're mixing the old API with the new one for the custom component definition. With model: defaultModel.extend({ was required an inner static isComponent (you're using one outside, like in the new API) and without it, you're breaking the Component Type Stack You should just change model: defaultMo...
UPDATE: If i just extend my custom components from textnode instead of default, then the issue gets resolved somehow: but it will be better if the issue is resolved at default as well. cheers
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3316
The editor does not remove the dead script blocks
Version: 0.16.34 Are you able to reproduce the bug from the demo? [ ] Yes [x ] No As I understand the code import dialog skips all the HTML...
Issue #3727
Issue on Style Import
Hi @artf, Describe the bug detailed While creating a new template using GrapesJS, I came across a scenario that, when we try to import CSS...
Issue #3279
how to make textnode editing update component content?
I'm building a custom textarea component and want it to behave like the built in text component such that editing the textnode on the grape...
Issue #6152
CSS added via custom code persists after custom code component is removed
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? any Reproducible demo link https://grapesj...
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.