GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS

Home Page:http://grapesjs.com/demo-mjml.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG: Components disappearing/not being rendered at cloning, moving or adding

gustavohleal opened this issue · comments

As already mentioned on grapes-js#4247 issue, there is a problem with navbar-link and columns in mjml plugin. The video show the basic problem in the issue mentioned but I was able to track down the problem to the render function called from those components.
I didn't found yet where this starts but the problem is reflect on the function addToCollection of ComponentsView.js from the main source of the grapes.
The component is cloned/added to the container it is supposed to be added, but when the function try to insert into it seems like is pointing to the wrong parentEl of the component view. It is pointing to a parent that does not exist.
At one moment the element is cloned/added and rendered to the canvas but when it comes to treat the event and call addToCollection function he identifies that this parentEl does not have any children and has no last index, then append the new/cloned component to him. And then at any new change that triggers a new renderization of the container component the bug is fixed bringing back to the canvas the missing component.
The video below show the problem.

3.mp4

Didn't find yet where exactly the component is create with the wrong parent, but I believe it starts on the render() function of navbar and column components.
This bug is reproducible on the grapesjs-mjml demo.

This should be fixed in the latest release.