Issue #1247💬 AnsweredOpened June 29, 2018by algodata440 reactions

Text disappear after creating a new type

Quick answerby artf

Wrong position for isComponent, it should be passed in the second argument object So it's like not declaring it, and as mentioned in ComponentsAs you're putting a new Component type on top of the stack, not declaring isComponent() might probably break stuff, especially if you extend the default one.

Read full answer below ↓

Question

Hello! I am creating a new block that will open a modal during the creation (drag and drop https://github.com/artf/grapesjs/issues/174 really helped me and it works. But it had a surprising side-effect: When I select and deselect a text component, the text disappear. Here is the code, I think I changed the defaultType property unintentionally:

Answers (3)

artfJune 30, 2018

Wrong position for isComponent, it should be passed in the second argument object So it's like not declaring it, and as mentioned in ComponentsAs you're putting a new Component type on top of the stack, not declaring isComponent() might probably break stuff, especially if you extend the default one.

algodata44July 2, 2018

It works perfectly, thank you!

lock[bot]September 17, 2019

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.