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

Auto-sizing doesn't work if children have only min_height. #591

Open
viridia opened this issue Dec 9, 2023 · 4 comments
Open

Auto-sizing doesn't work if children have only min_height. #591

viridia opened this issue Dec 9, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@viridia
Copy link

viridia commented Dec 9, 2023

taffy version

v0.3.18

Platform

Rust OS/X

What you did

In Bevy, I create a container element whose height is 'auto', and whose layout is a flex column. I then give it several children whose height is specified by min_height.

What went wrong

I would expect the container to compute its height so as to fit all the children. Instead, the container height is minimal (only padding), and the children overflow the container.

However, if I change the children to have height instead of min_height, it works correctly.
Alternatively, if I add some text nodes inside the children, it also works correctly.

Additional information

Minimal example using Bevy: sizing_bug.rs.zip

@viridia viridia added the bug Something isn't working label Dec 9, 2023
@nicoburns
Copy link
Collaborator

I am unable to reproduce this. The following HTML snippet causes the outer div to have a height of 90px on both web and with Taffy:

<div id="test-root" style="display: flex; flex-direction: column; width: 50px;">
  <div style="min-height: 20px;"></div>
  <div style="min-height: 30px;"></div>
  <div style="min-height: 40px;"></div>
</div>

@viridia
Copy link
Author

viridia commented Dec 12, 2023

Well, I can certainly reproduce it. Did you get a chance to try the minimal example I posted?

@nicoburns
Copy link
Collaborator

Well, I can certainly reproduce it. Did you get a chance to try the minimal example I posted?

Oh sorry, I completely missed that you'd posted a code example. I will check it out.

@nicoburns
Copy link
Collaborator

I briefly looking into this, and I was able to reproduce the issue using your provided bevy sample. But I was not able to reproduce the issue when translating it into a Taffy gentest. Will try to investigate this further when I get a chance.

@nicoburns nicoburns changed the title Auto-sizing does't work if children have only min_height. Auto-sizing doesn't work if children have only min_height. Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants