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]: Card component stretches image on Safari #3187

Open
ihor-romaniuk opened this issue Aug 21, 2024 · 0 comments
Open

[bug]: Card component stretches image on Safari #3187

ihor-romaniuk opened this issue Aug 21, 2024 · 0 comments
Labels
bug Report of or fix for something that isn't working as intended

Comments

@ihor-romaniuk
Copy link
Contributor

ihor-romaniuk commented Aug 21, 2024

Bugs

When using the Card component parameter, images will not display correctly when an image with a large vertical aspect ratio is loaded. In such cases, the component is greatly stretched vertically, which distorts its proportions and makes it visually unattractive.

Browsers

  • Safari

Code example

Sandbox

<Card
  className="mb-4" 
  orientation={isSmall ? "vertical" : "horizontal"}
>
  <Card.ImageCap
    src="https://i.etsystatic.com/15125891/r/il/bc6b13/5877091810/il_fullxfull.5877091810_2mf0.jpg"
    srcAlt="Card image"
    logoSrc="https://via.placeholder.com/150"
    logoAlt="Card logo"
  />
  <Card.Body>
    <Card.Header
      title="Title"
      subtitle="Subtitle"
    />
    <Card.Section 
      title="Section title"
    >
      Here we want to display both Header and Section between ImageCap and Footer components, so we use Card.
      Body to accomplish that. 
    </Card.Section>
  </Card.Body>
  <Card.Footer orientation={isExtraSmall ? "horizontal" : "vertical"}>
    <Button>Action 1</Button>
    <Button>Action 2</Button>
  </Card.Footer>
</Card>

Expected result:

The image inside the Card maintains its proportions and is scaled within the available space of the component.
image

Actual result:

The image is greatly stretched horizontally and its proportions are distorted.
image

@ihor-romaniuk ihor-romaniuk added the bug Report of or fix for something that isn't working as intended label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant