-
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
* fix Container min-height produces incorrect size when flex-wrap and… #1493
Conversation
cattenblue
commented
Dec 4, 2023
- fix Container min-height produces incorrect size when flex-wrap and Height is Auto
Hi @cattenblue! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign 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 to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Could you help by providing some more detail on the root cause, and why this change fixes it? |
┌─────────────────────────────────┐
│ │ Each box has size: 100 x 300 and the height is auto ,the mini height is 400
│ │ The expected height is 600, but the result is 800.
│ ┌──────┐ ┌──────┐ ┌──────┐ │ This is because each line is clamped to the min/max size specified on the container.
│ │ │ │ │ │ │ │ I believe this operation is not necessary for each line,
│ │ 1 │ │ 2 │ │ 3 │ │ so I removed it,and it worked fine
│ │ │ │ │ │ │ │ Is there any particular reason that
│ └──────┘ └──────┘ └──────┘ │ we should clamp to the min/max size specified on the container for each line?
│ │
│ │
│ ┌──────┐ │
│ │ │ │
│ │ 4 │ │
│ │ │ │
│ └──────┘ │
│ │
│ │
└─────────────────────────────────┘
|
Ah, that makes sense. If we have multiple lines, a line is allowed to be less than the min height of the parent container. Looks like the algorithm is specified by https://www.w3.org/TR/css-flexbox-1/#algo-cross-line
Let me read how we normally handle this for multi-line. Need to see if we can get rid of clamping entirely, or if we do it somewhere else again later. |
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
Thank you for your response, and I look forward to your revisions. |
…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: X-link: facebook/yoga#1513 X-link: facebook/react-native#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
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