Issue #1306šŸ’¬ AnsweredOpened July 23, 2018by jvillena1 reactions

Inserting text in an canvas element is not updated on the HTML content after saving it.

Quick answerby BlazedCodeā¤ 1

Hi @jvillena. Would you mind sharing some of your code please? I'm attempting to do the same thing but I just can't figure it out. I keep adding <span> tags as "placeholders" to insert the variable values, but they are always added to the front of the string and not at cursor position. Else if I do it another way, the...

Read full answer below ↓

Question

H @artf, I have a pitfalls in the middle of saving the HTML content. Right now we have a popup modal dialog where I can select some special text and inject on the canvas in the selected element. The issue is when saving the HTML content the changes are not reflected on it. It likes I have to refresh or update the model but I don't know how to update it. Note: Only save the data after inserting more than one times. But the latest change added is not saved. http://recordit.co/Mx1wggkdJT var text = editorRTE.getSelected().view.$el[0].innerHTML; String.prototype.splice = function(idx, rem, str) {...

Answers (3)

BlazedCode• December 11, 2018

Hi @jvillena. Would you mind sharing some of your code please? I'm attempting to do the same thing but I just can't figure it out. I keep adding <span> tags as "placeholders" to insert the variable values, but they are always added to the front of the string and not at cursor position. Else if I do...

jvillena• July 24, 2018

I've just solved. I had to render the DomComponents after applying the changes. The solution was:

artf• July 25, 2018

No, with this editorRTE.DomComponents.render() you're triggering the render of all component, please read carefully about Components, by looking at stuff like this editorRTE.getSelected().view.$el[0].innerHTML = value I think you just didn't get how really components work

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.