-
Notifications
You must be signed in to change notification settings - Fork 107
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
How to work with leaf nodes? #50
Comments
Hey! Beside that the lib author probably has more insight into this! |
I encounter a similar issue, where I have a setup like this:
and the flexible part can grow to a very large size. It's measuring function tries to respect that it may not have enough space to fit, but it never actually gets the bounds as they are being given as 'undefined'. This means that it always returns its maximum width, pushing off the right content into oblivion. This makes it very inconvenient to use, as it IMO throws out the idea behind Flexbox (which is to dynamically use existing space, and not 'make up' new space by pushing items off.) |
I am also hitting this issue - are there any workarounds? Edit: Returning 0/0 if the constraints are undefined seems to work. Edit: Actually I put my node tree in Chrome, and it seems the behavior is the same. Edit: Looking at what Chrome does, it looks like the overflow property is what is needed here. |
Hi,
I've been wondering how to work with leaf nodes. I have following code:
which results in following output:
I'm scratching my head here. Why the sum of widths of
node1
andnode2
are greater than the number passed tocompute_layout
?If I understand this correctly, leaf nodes should represent a content inside a flexbox container (which is represented by a normal node). The leaf requests some size, which is returned by the
MeasureFunc
passed to the leaf.Why
node1
andnode2
grow beyond the size of theroot
? Shouldn't they shrink to 50 points each? Should the leaf nodes shrink too?Am I misunderstanding something?
Would the
overflow
property fix this if it were implemented?I also don't understand the meaning of the
Size
argument which is passed into theMeasureFunc
. It's not explained in the documentation in any way. In above program, if I print the argument of theMeasureFunc
I see it's called multiple times (which is understandable - the layout engine probably does multiple passes), but thewidth
andheight
properties make no sense to me. Thewidth
is alwaysUndefined
.The text was updated successfully, but these errors were encountered: