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

Web Inconsistency: Sometimes horizontally centered node has incorrect left #476

Closed
rigdern opened this issue Mar 11, 2017 · 1 comment
Closed

Comments

@rigdern
Copy link

rigdern commented Mar 11, 2017

Repro

The innermost node is being horizontally centered but it is given an incorrect left position. Here's a small repro which I extracted from my team's app:

<div style="height: 52px; width: 52px; position: absolute; align-items: center; justify-content: center; left: 72px;">
  <div style="align-items: center;">
    <div style="width: 52px; height: 52px; margin-left: 10px; margin-right: 10px;"></div>
  </div>
</div>

Expected Output

{layout: {width: 52, height: 52, top: 0, left: 72}, children: [
  {layout: {width: 72, height: 52, top: 0, left: -10}, children: [
    {layout: {width: 52, height: 52, top: 0, left: 10}, },
  ]},
]},

Actual Output

The innermost node's left is 0 but it should be 10.

{layout: {width: 52, height: 52, top: 0, left: 72}, children: [
  {layout: {width: 72, height: 52, top: 0, left: -10}, children: [
    {layout: {width: 52, height: 52, top: 0, left: 0}, },
  ]},
]},
facebook-github-bot pushed a commit that referenced this issue Mar 15, 2017
Summary:
This fixes ```align-content: center``` and ```align-content: flex-end``` when the child exceeds the parents size. See #476. It also fixes those layouts if the child has ```margin: auto``` set.
Closes #477

Differential Revision: D4697833

Pulled By: emilsjolander

fbshipit-source-id: d081ec7ea559a5f2bd3271c3a4dc272960beddfa
@rigdern rigdern changed the title Sometimes horizontally centered node has incorrect left Web Inconsistency: Sometimes horizontally centered node has incorrect left Apr 12, 2017
@rigdern
Copy link
Author

rigdern commented Sep 19, 2017

I confirmed this doesn't repro in master (bcc36cc).

@rigdern rigdern closed this as completed Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant