Issue #4448πŸ’¬ AnsweredOpened Jul 14, 2022by ronaldohoch0 reactions

Error on resize image.

Quick answerby artf

Hi Ronaldo, I'm not sure if there is a simple way to fix this behavior globally for all use cases as you're resizing the image for both sizes and not only the width (in that case the height wouldn't change). What I can suggest trying is to extend the image component with this option for resizable Let me know if that w...

Read full answer below ↓

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Brave Browser Last version Reproducible demo link https://grapesjs.com/demo.html Describe the bug How to reproduce the bug?Opens the demo page.Puts an image.Double click to select image.Set width to 100%.Set height to auto or click on the x in height property.Resize image, you will see that width keeps in % and height is calculated in pixelsClick on the preview eyeSee that the image is flattened. What is the expected behavior? Resize algorithm should calc in pixels instead of mix them What is the...

Answers (4)

artfβ€’ Jul 18, 2022

Hi Ronaldo, I'm not sure if there is a simple way to fix this behavior globally for all use cases as you're resizing the image for both sizes and not only the width (in that case the height wouldn't change). What I can suggest trying is to extend the image component with this option for resizable L...

gustavohlealβ€’ Jul 18, 2022

Hi @artf. One way we thought to fix this for our use case based on our users is to change the units for width and height always together. That means when the user changes the width from pixels to %, for example, the height will also be changed to %. Is there a way to do this? Also, how can we chang...

ronaldohochβ€’ Jul 18, 2022

Let me know if that works for you

Hi Arthur, these configuration didn't make any changes to the image, it keeps setting the height with px instead of auto, as property keepAutoHeight suggest

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @ronaldohoch. Great question about Error on resize image.. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most operations can be achie...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.