Files
yoga/gentest/fixtures/YGDisplayTest.html
Eric Rozell 342aebe1d7 Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute (#1068)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1068

There is an issue in react-native when the Yoga node position type is set to absolute and display: none is set where the node layout calculation gives the absolute dimensions, rather than the expected 0 x 0.

Here are some OSS issues tracking this:
https://github.com/facebook/react-native/issues/18415
https://github.com/microsoft/react-native-windows/issues/7289

## Changelog

[General] [Fix] - Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute

Reviewed By: Andrey-Mishanin

Differential Revision: D26849307

fbshipit-source-id: 197618aa3c4e1b3b7efeba7ea4efd30b2d1c982d
2021-03-10 13:10:32 -08:00

32 lines
1.2 KiB
HTML

<div id="display_none" style="width: 100px; height: 100px; flex-direction: row;">
<div style="flex-grow: 1;"></div>
<div style="flex-grow: 1; display:none;"></div>
</div>
<div id="display_none_fixed_size" style="width: 100px; height: 100px; flex-direction: row;">
<div style="flex-grow: 1;"></div>
<div style="width: 20px; height: 20px; display:none;"></div>
</div>
<div id="display_none_with_margin" style="width: 100px; height: 100px; flex-direction: row;">
<div style="width: 20px; height: 20px; display:none; margin: 10px;"></div>
<div style="flex-grow: 1;"></div>
</div>
<div id="display_none_with_child" style="width: 100px; height: 100px; flex-direction: row;">
<div style="flex: 1;"></div>
<div style="flex: 1; display:none;">
<div style="flex: 1; width: 20px;"></div>
</div>
<div style="flex: 1;"></div>
</div>
<div id="display_none_with_position" style="width: 100px; height: 100px; flex-direction: row;">
<div style="flex-grow: 1;"></div>
<div style="flex-grow: 1; display:none; top: 10px;"></div>
</div>
<div id="display_none_with_position_absolute" style="width: 100px; height: 100px;">
<div style="display:none; position: absolute; width: 100px; height: 100px"></div>
</div>