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

max-height, flex-grow don't work well together -- incorrect size calculations / unallocated space #967

Open
1 task done
brianwestphal opened this issue Feb 3, 2020 · 3 comments

Comments

@brianwestphal
Copy link

Report

Issues and Steps to Reproduce

See http://tinyurl.com/sgeap6b

When allocating space combining min/max height and flex-grow, space is often left unallocated inside a flex box.

Expected Behavior

No unallocated space

Actual Behavior

Unallocated space at the bottom of the container

Link to Code

http://tinyurl.com/sgeap6b

Notice that the space at the bottom is in the container and doesn't contain a child component -- even though the largest sub-component has a 1000px max-height.

Running the same flex layout parameters in a web browser (e.g. safari and chrome) works as expected, without unallocated space. And according to the documentation, the implementations should be largely compatible between the web and react-native.

Screen Shot 2020-02-03 at 1 04 41 PM

@starFelix
Copy link

I have same problem. It seems that flex-grow in yoga only works when parent has a fixed size. I had to add fixed width/height for parent to make it works.

@woehrl01
Copy link
Contributor

Hi @brianwestphal,

thanks for reporting, the current algorithm doesn't comply correctly to the spec here. I mentioned the underlying problem in more depth in PR #1015 .

@brianwestphal
Copy link
Author

Thanks @woehrl01, glad this is being worked on! It's been killing me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants