Issue #3222๐Ÿ’ฌ AnsweredOpened Jan 7, 2021by bgrand-ch0 reactions

How to refresh/re-render after new node added?

Quick answerby bgrand-ch

Optimized TextEditor.vue file: But the problem persist:โœ”๏ธ span node replaces the previous content of selection, with font-family and color styles.โŒ span node isn't recognized by GrapesJS, because there isn't GrapesJS auto-generated styles ID and data-gjs-type='text' attribute.โŒ getHTML and getJSON to save modification...

Read full answer below โ†“

Question

I manually add a new node into a rendered component. The visual result is OK, but impossible to save, because my style isn't with the auto-generated GrapesJS ID. To manually resolve this poblem, I double-click on the component to enter to it and I click outside in the canvas body. Then, the GrapesJS ID and data-gjs-type='text' are added to the new node, and save is possible. Vue.js: A part of Main.vue file: A part of TextEditor.vue file:

Answers (3)

bgrand-chโ€ข Jan 8, 2021

Optimized TextEditor.vue file: But the problem persist:โœ”๏ธ span node replaces the previous content of selection, with font-family and color styles.โŒ span node isn't recognized by GrapesJS, because there isn't GrapesJS auto-generated styles ID and data-gjs-type='text' attribute.โŒ getHTML and getJSON...

bgrand-chโ€ข Jan 11, 2021

โ„น๏ธ Don't works directly with HTML, works only with JSON. Component = JSON node (html element + GrapesJS data) Sources:https://grapesjs.com/docs/modules/Components.htmlhttps://grapesjs.com/docs/api/component.html

GJSBlockโ€ข May 17, 2026

Thanks for reporting this, @bgrand-ch. Great question about How to refresh/re-render after new node added?. The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most op...

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.