GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
624 stars 222 forks source link

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

Closed gustavohleal closed 1 year ago

gustavohleal commented 2 years ago

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.

https://user-images.githubusercontent.com/22385451/163436302-e9367ea5-137e-410d-93cb-7d5254e17a7e.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.

ronaldohoch commented 2 years ago

Up

artf commented 1 year ago

This should be fixed in the latest release.