-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Issue facebook/css-layout#127]: content re-layout of stretched items #145
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
Conversation
@alebo: Great! this also seems to solve #83 But I had to pass: |
@alebo: there is still an issue with this one. If you have |
@woehrl01 Thanks for your comments. I can investigate it further. |
@alebo @vjeux I just looked at the tests, and in my opintion those are false negatives. If you add those children, the layout should be @alebo according your update, sorry to bother you but if you have a lot of nested streching layouts, sometimes the position gets fully set to 0 (they are left aligned), and so they are off. So I think this is still not totally correct :( I think that reseting the
at least in my scenarios the output is now as expected. |
@woehrl01 if an item has MarginTop and MarginLeft resetting both axes might be required but it seems that only the margins (rather than the entire position) need to be reset. Those failed tests seem to be false negatives indeed (but by pure accident they helped catch an actual problem too). |
This also fixes #100 |
@alebo looks really good to me. Awesome job! 👍 |
What still needs to be done to get this merged? It has tests and (to my unfamiliar-with-css-layout eye) doesn't appear too complex. |
@alebo looks good to me! Would be great to get this merged :) |
I'm ready to rebase this and resolve conflicts as soon as there's any feedback from the project maintainers. |
pinging @vjeux again, more people are running into this issue over at RN. |
I'm sorry but won't be looking into it in a while. @lucasr do you have time to review this? |
I think I need a little more context on the changes before reviewing (see questions). |
And thanks for the contribution! ;-) |
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
@alebo @lucasr @vjeux any chance we can get some eyes on this again? I reduced the problem to a very simple example and there's a basic gap in meeting spec in RN: Screenshot (expected behavior in RN's Fiddle layout sandbox, but not in iPhone simulator): http://screencast.com/t/H3Da1mQhmLX3 |
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
…fined size in the cross-axis Summary: Fetched and rebased facebook#145 and updated it to do 2 things: 1) Make 'stretch' aligned children grow to fill their containers in the cross-axis if the cross-axis size is undefined. The added test might be the best explanation of this. 2) Make sure this doesn’t decrease the frequency of the “simpleStackCross” optimization in a relatively complex sample environment. Test Plan: Added a test: Container with 3 row directioned children and no explicit height set. One child is of height 0, one of 0 height with stretch alignment, and one of 150 height. Expected the 0 height child remains of height 0, stretch grows to 150, and 150 stays the same.
Squash away! |
Trying to fix #127.