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

Measure nodes which have margin: auto and align-item: stretch #645

Closed
wants to merge 2 commits into from

Conversation

woehrl01
Copy link
Contributor

@woehrl01 woehrl01 commented Oct 8, 2017

If you have a measurable node and set marign-left: auto + align-item:stretch on it, it won't get measured and they get a width/height of -(nan). This change fixes that behaviour. Fixes #644.

@woehrl01 woehrl01 changed the title Margin auto measure Measure nodes which have margin: auto and align-item: stretch Oct 8, 2017
@emilsjolander
Copy link
Contributor

@woehrl01 Can you ensure we have a test case to catch the case where we have auto + stretch without a custom measure? Both when node has explicit and non-explcit size set.

@woehrl01
Copy link
Contributor Author

woehrl01 commented Nov 24, 2017

If I remember correctly we already have that in place for non custom measure nodes. This change is only needed for custom measure nodes. I added those when I initially added the auto margin support.

@emilsjolander
Copy link
Contributor

I can't find any test in https://github.com/facebook/yoga/blob/master/tests/YGMarginTest.cpp which sets auto margin without defined width/height (thus relying on stretch behaviour). Could you add one?

@woehrl01
Copy link
Contributor Author

woehrl01 commented Nov 24, 2017

Sure 👍 I'll have a look in the next couple of hours. I'm currently out of office.

@emilsjolander
Copy link
Contributor

👍

@woehrl01
Copy link
Contributor Author

woehrl01 commented Nov 24, 2017

@emilsjolander I hope these are the kind of tests you are looking for. 🔬

@emilsjolander
Copy link
Contributor

Looks good!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emilsjolander is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Nov 27, 2017
Summary:
If you have a measurable node and set ```marign-left: auto``` + ```align-item:stretch``` on it, it won't get measured and they get a width/height of ```-(nan)```. This change fixes that behaviour. Fixes #644.
Closes #645

Differential Revision: D6413512

Pulled By: emilsjolander

fbshipit-source-id: 755febeb33bb0d4520ca6b3c28d56ac333e4a14d
facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Nov 27, 2017
Summary:
If you have a measurable node and set ```marign-left: auto``` + ```align-item:stretch``` on it, it won't get measured and they get a width/height of ```-(nan)```. This change fixes that behaviour. Fixes #644.
Closes facebook/yoga#645

Differential Revision: D6413512

Pulled By: emilsjolander

fbshipit-source-id: 755febeb33bb0d4520ca6b3c28d56ac333e4a14d
bowerman0 pushed a commit to bowerman0/react-native that referenced this pull request Dec 5, 2017
Summary:
If you have a measurable node and set ```marign-left: auto``` + ```align-item:stretch``` on it, it won't get measured and they get a width/height of ```-(nan)```. This change fixes that behaviour. Fixes facebook#644.
Closes facebook/yoga#645

Differential Revision: D6413512

Pulled By: emilsjolander

fbshipit-source-id: 755febeb33bb0d4520ca6b3c28d56ac333e4a14d
bowerman0 pushed a commit to bowerman0/react-native that referenced this pull request Dec 5, 2017
Summary:
If you have a measurable node and set ```marign-left: auto``` + ```align-item:stretch``` on it, it won't get measured and they get a width/height of ```-(nan)```. This change fixes that behaviour. Fixes facebook#644.
Closes facebook/yoga#645

Differential Revision: D6413512

Pulled By: emilsjolander

fbshipit-source-id: 755febeb33bb0d4520ca6b3c28d56ac333e4a14d
vincentriemer pushed a commit to vincentriemer/yoga-dom that referenced this pull request May 9, 2018
Summary:
If you have a measurable node and set ```marign-left: auto``` + ```align-item:stretch``` on it, it won't get measured and they get a width/height of ```-(nan)```. This change fixes that behaviour. Fixes #644.
Closes facebook/yoga#645

Differential Revision: D6413512

Pulled By: emilsjolander

fbshipit-source-id: 755febeb33bb0d4520ca6b3c28d56ac333e4a14d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when a node is both stretch and auto, get the result with width and height "null"
3 participants