Inserting text in an canvas element is not updated on the HTML content after saving it.
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)
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...
I've just solved. I had to render the DomComponents after applying the changes. The solution was:
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.
Issue #1408
Why Text element converted into box ??
Hi @artf , I am using grapesjs newsletter plugin with ckeditor plugin. I dragged TEXT element in canvas and did some editing with ckeditor....
Issue #1363
Problem trying to inject new HTML content in the Editor
Hi @artf, I'm now working on doing content in multi-languages inside the editor but I would like to know how can I save in the Dom HTML new...
Issue #1128
Bug in dragging selected text
hi @artf as you can see my screenshot when you drag textblock than select text in that element and drag it to bottom of content than text g...
Issue #1479
Custom element with pop-up
hello @artf I've make pop-up for select custom link data but data is save and also display when we click on export html. But data is not re...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins ā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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.