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

Margin styles are creating unexpected behaviour in the new Image component #18344

Closed
harshvitra opened this issue Oct 27, 2020 · 5 comments
Closed
Assignees
Milestone

Comments

@harshvitra
Copy link

Bug report

Describe the bug

Margin styles are creating unexpected behaviour in the new Image component

Issue is because of position relative+absolute combination

The structure Image component creates -

<Image styles /> is replaced by

<div> // with the width passed to image
   <div> // position relative
       <img /> // position absolute with the margin and other styles
   </div>
</div>

Issue is that the margin along with other styles are passed to the img component which has absolute position so it spoils the designs

To Reproduce

Add margin to the Image component and see the unexpected behaviour

Expected behavior

Expected that the margin is applied to the parent div and not to child

In the case of Image component it should be applied to the Wrapper

Screenshots

Screenshot 2020-10-28 at 2 41 18 AM

Additional context

This can be added in the to do here
#18122

@Timer Timer added this to the iteration 11 milestone Oct 28, 2020
@Timer Timer added the point: 2 label Oct 30, 2020
@Timer Timer modified the milestones: iteration 11, iteration 12 Oct 30, 2020
@lachlanjc
Copy link
Contributor

@Timer
Copy link
Member

Timer commented Nov 1, 2020

Can you please try next@canary and see if it fixes your issue?

@lachlanjc
Copy link
Contributor

Yep, already did! Thanks.

@Timer
Copy link
Member

Timer commented Nov 2, 2020

Closing as fixed on next@canary. Thanks!

@Timer Timer closed this as completed Nov 2, 2020
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants