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

minus total outer flex basis for available width or height, when compute flex basis for children #858

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shiyizju
Copy link

I put an ImageView and an UILabel in a horizontal flex layout, the label's size is not calculated correctly. The size passed to UILabel's sizeThatFits is not correct. I think it should minus the previous calculated totalOuterFlexBasis.

Thanks.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@woehrl01
Copy link
Contributor

Thanks @shiyizju for your pull request.

Could you please add a test case for this change, to prevent a possible regression?

Thanks!

@shiyizju
Copy link
Author

shiyizju commented Feb 1, 2019

Thanks @shiyizju for your pull request.

Could you please add a test case for this change, to prevent a possible regression?

Thanks!

Thanks @woehrl01 for reply.

I ran the test cases and it failed with following output:

====STANDARD OUT====
tests/YGPersistenceTest.cpp:208: Failure
Expected: YGNodeGetChild(root2_child1, 0)
Which is: 0x7f8eb9809200
To be equal to: root_child1_0
Which is: 0x7f8eb9808c00
TESTS FAILED: 1 FAILURE
Failed target: //:YogaTests
FAIL //:YogaTests

I don't understand the test case very well referenced in the output, could you please help check if I miss something, or maybe my change is not correct?

Thanks.

@woehrl01
Copy link
Contributor

woehrl01 commented Feb 1, 2019

To be honest, I'm not sure about this specific testcase. But it seems more of a bug in the cloning process.

It would be great if you use the existing /gentest/fixtures/YGFlexTest.html + /gentest/gentest.rb to generate a specific test scenario (see README#Testing).

Please keep in mind that there a vast amount of code at FB that depends on Yoga and thus it might not be possible to fix all bugs, due to introducing a breaking change.

@davidaurelio davidaurelio self-requested a review February 1, 2019 09:19
@davidaurelio davidaurelio self-assigned this Feb 1, 2019
@shiyizju
Copy link
Author

shiyizju commented Feb 2, 2019

I met this problem in iOS environments with YogaKit. Following I upload a demo to reproduce this problem, please take a look. Let me know if there is any problem. Thanks!

https://github.com/shiyizju/YogaTryout

@shiyizju
Copy link
Author

shiyizju commented Feb 13, 2019

Hi, @davidaurelio , could you please let me know if this issue is being followed up? Thanks.

@davidaurelio davidaurelio removed their assignment Jun 19, 2020
@davidaurelio
Copy link
Contributor

@SidharthGuglani could you remove me as a reviewer here? Thanks!

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.

5 participants