Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Found a Bug in MJML Image Block #339

Open
RakulAgn opened this issue Oct 27, 2023 · 5 comments
Open

BUG: Found a Bug in MJML Image Block #339

RakulAgn opened this issue Oct 27, 2023 · 5 comments

Comments

@RakulAgn
Copy link

Description:

When attempting to set the height and width of an image to "auto" in the Grapesjs MJML Example on the official site, an error is thrown in the Chrome console. Once this error occurs, the image cannot be cloned unless it is completely removed.

### Steps to Reproduce:

  • Navigate to the Grapesjs MJML Example on the official site.
  • Add a section and drop an image into it.
  • Open the Chrome Developer Console.
  • Set the image's height and width to "auto" by typing the word "auto" in the respective input fields.
  • Observe the error in the console: TypeError: Cannot read properties of undefined reading toString
  • Attempt to clone the image.

Expected Behavior:

The image's height and width should adjust to "auto" without any errors. Cloning functionality should remain unaffected.

Actual Behavior:

An error is thrown in the console when setting the image's height and width to "auto". Cloning functionality for the image is disabled until the image is completely removed.

@RakulAgn
Copy link
Author

@artf

@RakulAgn RakulAgn changed the title Hey I Found a Bug in MJML Image Block BUG: Found a Bug in MJML Image Block Oct 27, 2023
@ronaldohoch
Copy link

Hi @RakulAgn, auto is not a valid value to mj-image, if you remove the width property of mj-image it will be set to 100%.
image
https://mjml.io/try-it-live/4WyCHcXK1A

@RakulAgn
Copy link
Author

Yeah thats right but its not handled in grapesjs mjml. in user point of view what if they type auto incase ?

@ronaldohoch
Copy link

Thanks for finding this.

Here we have a custom build of mjml, so we have solved :D

Also, i've made a PR to it. #344

@RakulAgn
Copy link
Author

Thanks dude it took 2 month :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants