Open joshdholtz opened 9 years ago
(Sorry for taking so long to answer!)
Ah, yeah, so this is kinda interesting.
Input
has a default frame: https://github.com/joshaber/Few.swift/blob/b53fbd13026cf13327b2a66fc87f9189787656bb/Few-iOS/Input.swift#L56
which means the layout algorithm will use that instead of taking into account stretchedness, etc. You can fix that by giving it an undefined width:
Input(...).width(Node.Undefined)
Then it'll stretch as you'd expect.
But also, be sure to update Few. I just fixed a bug (#80) that would cause the above fix to crash :trollface:
@joshaber I was about to say thanks for answering so quickly! I know how hard it is to stay on top of things :innocent: But I will give that a shot! And is there any reason why Input
has a default width of 100
?
And is there any reason why Input has a default width of 100?
Mostly because at the time it seemed like a good idea to have a reasonable default frame. Probably worth revisiting now.
That is valid reasoning :ok_hand: I just want to prevent others from getting hung up on the same thing like I did. Few is super easy to use and I don't want this to deter others from using it if they run into it :blush: I could work on a PR for it if you wouldn't mind.
I could work on a PR for it if you wouldn't mind.
That'd be great! I wonder if we should still have a default but leave the width undefined?
The
Input
element does not seem to follow the.childAlignment(.Stretch)
property. I have attached a screenshot (I'm bad at designing but these colors are used for clarity of the issue :wink:) and the example view code. I believe my code is right as the "Welcome!"Label
and the bottom border views are stretched. BUT please let me know if it is something with just my code :innocent:Screenshot (duh)
Code (even more duh)