Issue #2918Opened July 25, 2020by neon123450 reactions

BUG: textnode is not removed from canvas

Question

Code SnippetTEXT
Text imported directly to the wrapper is not removed from the canvas with the component. 

To verify one can import simple texts multiple times to the demo and watch how they combine instead of replacing the previous one.

Adding this seems to help:

        editor.DomComponents.addType('textnode', {
            model: {
                removed() {
                    var el = this.getEl();
                    el.parentNode.removeChild(el);
                }
            }
        });

Tested with the demo v0.16.18.

Answers (3)

artfAugust 7, 20200 reactions

I don't follow your example, can you illustrate exact steps to reproduce, please?

neon12345August 7, 20200 reactions

Go to the newsletter demo at https://grapesjs.com/demo-newsletter-editor.html and use the "Import template" function with simple text like "hello" but no html (or combine it with html and text on the root level). Repeat this and the text on the root level will not be removed but add up on each import.

artfAugust 27, 20200 reactions

Thanks @neon12345, I was able to find the issue and it should be fixed in the next release

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.