Skip to content

Fix issue when resizing images in RTE

What does this MR do and why?

Fix issue when resizing images in RTE

When resizing images, we get dimensions from the DOM to begin resize. But if the dimensions are "auto", doing a parseInt on them results in NaN. In that case we should fall back to computed values of width and height.

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screen Recording 2024-08-20 at 20.50.39.mov Screen Recording 2024-08-20 at 20.49.31.mov

How to set up and validate locally

  1. In rich text editor, insert a JPG or GIF image. (Note: the bug was only with non-retina images)
  2. Try to resize it.
  3. It should resize properly.
Edited by Himanshu Kapoor

Merge request reports

Loading