Issue #2740πŸ’¬ AnsweredOpened Apr 27, 2020by Gangkaroo1 reactions

Append does not work consistently

Quick answerby artf❀ 1

The Text component is composed of components container and content (printed after components), so when you use append it actually appends the node but you see it above as the content is printed below. We need the components container for a lot of reasons (even if in some cases is not even used). Technically you can't...

Read full answer below ↓

Question

Are you using the latest release (older versions are NOT supported)? Yes Are you facing the bug with your local copy of GrapesJS or with the current demo? Local and current demo I'm using editor.getSelected().append() to add Text to the currently selected component in the editor. This seems to consistently work when looking at the HTML code in the code editor, however in the view the text does not always get appended but instead, in most of the cases, is shown as prepended. After refreshing the page, however, the text is shown as appended at the end of the component. Tested in current version...

Answers (1)

artfβ€’ May 20, 2020

The Text component is composed of components container and content (printed after components), so when you use append it actually appends the node but you see it above as the content is printed below. We need the components container for a lot of reasons (even if in some cases is not even used). Te...

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.