-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Container min-height
produces incorrect size when flex-wrap
is enabled
#1300
Comments
can I work on this? |
Contributions are welcome 🙂. Are you familiar with Yoga's system for test fixtures. |
Yeah, |
@rasjonell hey can you try this?
|
This won't work. First I can't just rely on the sum of computed heights, as not all elements are necessarily wrapped, for example I may have a case like this:
If I collect the sum of heights it won't represent the height of all the rows. I would have to also make some calculations to understand how many rows are there and then calculate the sum, which can be really expensive, considering every layout change would make the same calculation twice(once on yoga's side, once on my own). Another potential issue with this approach is that I would lose my |
can we follow the below approach?
|
Yes, this workaround will fix it, however it's really expensive, considering my client would need to recalculate stuff that's already calculated on Yoga's side. Also I would lose the |
@NextThread have you looked at fixing this inside of Yoga, instead of recommending workarounds? |
No, I'm a beginner so, before that I was trying to share my approach, should I try? |
Hello, I meet this exactly issue in my work.and I’m trying to fix it. |
I encountered the same issue and had a doubt about why clamping to the min/max size specified on the container is needed for each line. So, I tried removing it for each line, and I add three test. Here is my submission #1493 |
Summary: Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
Summary: Fixes facebook#1300 Fixes facebook#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook#1491 2. facebook#1493 3. facebook#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
Summary: Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
…41916) Summary: X-link: facebook/yoga#1513 Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
…1513) Summary: X-link: facebook/react-native#41916 Fixes facebook#1300 Fixes facebook#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook#1491 2. facebook#1493 3. facebook#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
…41916) Summary: X-link: facebook/yoga#1513 Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
…1513) Summary: X-link: facebook/react-native#41916 Fixes facebook#1300 Fixes facebook#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook#1491 2. facebook#1493 3. facebook#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Differential Revision: D52087013
…41916) Summary: X-link: facebook/yoga#1513 Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013
…1513) Summary: X-link: facebook/react-native#41916 Fixes facebook#1300 Fixes facebook#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook#1491 2. facebook#1493 3. facebook#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013
…1513) Summary: X-link: facebook/react-native#41916 Fixes facebook#1300 Fixes facebook#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook#1491 2. facebook#1493 3. facebook#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013
…41916) Summary: X-link: facebook/yoga#1513 Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013
Summary: Pull Request resolved: #1513 X-link: facebook/react-native#41916 Fixes #1300 Fixes #1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. #1491 2. #1493 3. #1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013 fbshipit-source-id: 8d95ad17e58c1fec1cceab9756413d0b3bd4cd8f
Summary: X-link: facebook/yoga#1513 Pull Request resolved: #41916 Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013 fbshipit-source-id: 8d95ad17e58c1fec1cceab9756413d0b3bd4cd8f
…41916) Summary: X-link: facebook/yoga#1513 Pull Request resolved: facebook#41916 Fixes facebook/yoga#1300 Fixes facebook/yoga#1008 This fixes a smattering of issues related to both sizing and aligment of multi-line-containers: 1. We were previously incorrectly bounding the size of each flex line to the min/max of the entire container. 2. Per-line leads were sometimes incorrectly contributing to alignment within the line 3. The cross dim size used for multi-line alignment is not correct, or correctly clamped. If the available size comes from a max constraint, that was incorrectly used instead of a definite size, or size of content. Leads were entirely skipped for min constraint. Need to test how breaking this is, to see if it might need to go behind an errata. See related PRs: 1. facebook/yoga#1491 2. facebook/yoga#1493 3. facebook/yoga#1013 Changelog: [General][Fixed] - Fix Yoga sizing and alignment issues with multi-line containers Reviewed By: joevilches Differential Revision: D52087013 fbshipit-source-id: 8d95ad17e58c1fec1cceab9756413d0b3bd4cd8f
Report
Issues and Steps to Reproduce
I use
yoga-layout
asm bindings.When I Create a container node where
width
is exact, but only setmin-height
, and enableflexWrap
:and add child nodes so that it goes to the next line.
Expected Behavior
The computed
height
property should be 240(120 + 120)Actual Behavior
The computed
height
property is 400.Seems like the container's
min-height
property is applied to each wrapped row.Notes
I tried both with and without web defaults.
This also happens on wrapped columns.
Please let me know if I'm missing something. Thanks!
The text was updated successfully, but these errors were encountered: