GrapesJS / mjml

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

mj-image breaking view when auto width is used #262

Closed nilchu closed 1 year ago

nilchu commented 2 years ago

Update:

Seems like the demo page is using v.0.1.10.

Checked the changelog for v0.2.9:

fix: display mj-image containing width="100%" correctly instead of showing the default mj-body width (550px)


Hello,

I'm facing the following issue:

When inserting an mj-image block, the image is shown in its original size in the canvas and not being stretched to fit the container. However the generated HTML has it taking up the whole available space.

I've checked the demo page and there it reflects the generated HTML.

When changing the width property from auto to a pixel value, it is updated accordingly but changing it back to auto breaks the view and it's no longer possible to select the image inside the canvas. Also % values act like pixel values.

Configuration:

grapesjs: 0.17.27 grapesjs-mjml: 0.5.6

Current behaviour screenshot-grapesjs-mjml-error

vs.

GrapesJS-MJML demo page screenshot-grapesjs-mjml-demo

Steps to reproduce:

  1. Open codepen demo
  2. Add image block
  3. Set width property to any pixel value
  4. Set width back to auto (<-- breaks view)

Thanks in advance.