GrapesJS / mjml

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

BUG: Wrapper component breaks when property is changed after deleting child section #385

Open akzhysparrow opened 3 weeks ago

akzhysparrow commented 3 weeks ago

GrapesJS version

GrapesJS MJML version

What browser are you using?

Brave Version 1.70.119 Chromium: 129.0.6668.70

Reproducible demo link

https://grapesjs.com/demo-mjml

Describe the bug

How to reproduce the bug?

  1. Go to the demo mjml page https://grapesjs.com/demo-mjml
  2. Drag and drop a wrapper component
  3. Delete one section from within the wrapper
  4. Select the wrapper and change any of its properties

What is the expected behavior?

The property change should be reflected without affecting the child components

What is the current behavior?

All the child elements inside the wrapper disappears

https://github.com/user-attachments/assets/d4e7f077-0def-4885-a986-dec2547adb48

Code of Conduct

akzhysparrow commented 3 weeks ago

It looks like the issue is due to appendChildren param of renderChildren being truthy. Overriding the rerender method in Wrapper.ts seems to fix it.

Wrapper.ts

rerender() {
  this.render(null, null, {}, false);
},