Skip to content

Commit

Permalink
Change default back to position: "relative" (#1469)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/react-native#41480

Pull Request resolved: #1469

The previous version of static didn't do anything inside of Yoga. Now that we're making it do something, this changes the default back to relative so that users with no errata set don't see their deafult styles changing.

Reviewed By: joevilches

Differential Revision: D51182955

fbshipit-source-id: c0ea357694e1367fb6786f1907dfff784b19a4bc
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Nov 29, 2023
1 parent bb8fd59 commit 382faa3
Show file tree
Hide file tree
Showing 67 changed files with 150 additions and 2,945 deletions.
4 changes: 2 additions & 2 deletions gentest/gentest.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function checkDefaultValues() {
{style: 'justify-content', value: 'flex-start'},
{style: 'align-content', value: 'flex-start'},
{style: 'align-items', value: 'stretch'},
{style: 'position', value: 'static'},
{style: 'position', value: 'relative'},
{style: 'flex-wrap', value: 'nowrap'},
{style: 'overflow', value: 'visible'},
{style: 'flex-grow', value: '0'},
Expand Down Expand Up @@ -643,7 +643,7 @@ function isDefaultStyleValue(style, value) {
if (defaultStyle == null) {
switch (style) {
case 'position':
defaultStyle = new Set(['static']);
defaultStyle = new Set(['relative']);
break;

case 'left':
Expand Down
3 changes: 0 additions & 3 deletions java/tests/com/facebook/yoga/YGAbsolutePositionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ public void test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_
root.addChildAt(root_child0, 0);

final YogaNode root_child0_child0 = createNode(config);
root_child0_child0.setPositionType(YogaPositionType.RELATIVE);
root_child0_child0.setWidth(100f);
root_child0_child0.setHeight(100f);
root_child0.addChildAt(root_child0_child0, 0);
Expand Down Expand Up @@ -1077,7 +1076,6 @@ public void test_percent_absolute_position_infinite_height() {
root.setWidth(300f);

final YogaNode root_child0 = createNode(config);
root_child0.setPositionType(YogaPositionType.RELATIVE);
root_child0.setWidth(300f);
root.addChildAt(root_child0, 0);

Expand Down Expand Up @@ -1177,7 +1175,6 @@ public void test_absolute_layout_percentage_height_based_on_padded_parent_and_al
final YogaNode root = createNode(config);
root.setJustifyContent(YogaJustify.CENTER);
root.setAlignItems(YogaAlign.CENTER);
root.setPositionType(YogaPositionType.RELATIVE);
root.setPadding(YogaEdge.TOP, 20);
root.setPadding(YogaEdge.BOTTOM, 20);
root.setWidth(100f);
Expand Down
Loading

0 comments on commit 382faa3

Please sign in to comment.