Issue #2831💬 AnsweredOpened June 15, 2020by mustahsanmustafa1 reactions

Text components don't behave correctly after creating custom components

Quick answerby artf1

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)

artfJune 18, 2020

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...

mustahsanmustafaJune 15, 2020

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.

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.