Image component with fit='contain' should constrain the height of the image inside the container #940
Labels
bug
Something isn't working
Checkout UI Components
This issue is related to the Checkout UI component library
Please list the package(s) involved in the issue, and include the version you are using
checkout-ui-extensions
Describe the bug
When using an image component with
fit='contain'
the image should be contained within the container.Steps to reproduce the behavior:
Image
with fit contain inside anInlineLayout
with fixed sizes. ex (using htm templates):Expected behavior
The image should be resized to the height of the container instead of overflowing out of it.
Screenshots
Additional context
Constraining the width works fine, I think this is because
max-width: 100%
is added to the image. Addingmax-height: 100%
when usingfit='contain'
should fix this issue.I'm open to other solutions here, but no combination of
InlineLayout
/BlockLayout
/View
with variousmaxInlineSize
ormaxBlockSize
have worked for me to constrain the height of the image. Another solution would be addingmaxWidth
andmaxHeight
properties to theImage
component as well.The text was updated successfully, but these errors were encountered: