Repository navigation
[WC-3633] fix(image-web): apply height in viewport units - #2533
Merged
Merged
Conversation
ContentImage and BackgroundImage overwrote the height from constructStyleObject with getStyle(), which only handled pixels and percentage and returned "" for viewport, so a height in vh was dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
AI Code Review
What was reviewed
Skipped (out of scope): none CI: pending: Snyk checks (code, license, security) · triage passed. Unit tests and E2E have not reported on this PR yet. Positives
|
leonardomendix
approved these changes
Nov 17, 2026
uicontent
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Stacked on #2511. Merge #2511 first; this PR then retargets to
main.Fixes one of the two older bugs QA listed on WC-3633 that #2511 did not cause and that also happen on
main: a height in viewport units (vh) is never applied to the image on the page.Cause.
constructStyleObject(utils/helpers.ts) buildsheight: 30vhcorrectly, butContentImageandBackgroundImageincomponents/Image/ui.tsxthen overwritestyle.heightwithgetStyle(height, heightUnit).getStyleonly handledpixelsandpercentageand returned""forviewport, which removes the height.Fix.
getStylereturns<value>vhforviewport.Verified in a Mendix 11.12.5 app at 1440 × 900, Image widget with a 400 × 300 px image, Width auto, Height 30 viewport:
<img>height: 30vh;Not in this PR: the other leftover, Escape in a pop-up closing both the lightbox and the pop-up. It did not reproduce on Mendix 11.12.5 with Image 1.6.1. The Mendix pop-up closes on Escape only when focus is inside it, and the lightbox moves focus to itself when it opens. More details from QA are needed (Mendix version, browser, how the lightbox was opened).
What should be covered while testing?
🤖 Generated with Claude Code