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

Closed
opened 2017-03-10 17:03:18 -08:00 by rigdern · 1 comment
rigdern commented 2017-03-10 17:03:18 -08:00 (Migrated from github.com)

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}, },
  ]},
]},
### 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}, }, ]}, ]}, ```
rigdern commented 2017-09-19 02:29:38 -07:00 (Migrated from github.com)

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

I confirmed this doesn't repro in master (bcc36cc).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#476
No description provided.