Size Constraints Example
Objective
Add a simple example demonstrating how to use size constraints.
Related to #7946
Solution
Changelog
- Added the example
size_constraints
Just spent ten minutes trying to fix why the min_size and max_size constraints didn't work. That's because of #7946 which was the reason for making the example in the first place :sweat_smile:.
Still needs a bit work on the presentation and some explanatory text, it'll wait till #7948 is merged.
It might be a good idea to give the node a non-zero content size to illustrate the difference between min_size: auto and min_size: 0. Then again, maybe that overcomplicates things. This does seem useful as it is.
It might be a good idea to give the node a non-zero content size to illustrate the difference between
min_size: autoandmin_size: 0. Then again, maybe that overcomplicates things. This does seem useful as it is.
Yeah, material for a separate example I think
The flex-basis property seems to have no effect here. If that's expected, I think we should probably just cut it from this example (and add another one to demonstrate this).
The flex-basis property seems to have no effect here. If that's expected, I think we should probably just cut it from this example (and add another one to demonstrate this).
Flex basis would have an effect if there were two child nodes (where it could be controlled separately). Which might make for a better example? Otherwise I agree that flex-basis probably ought to be removed.
The flex-basis property seems to have no effect here. If that's expected, I think we should probably just cut it from this example (and add another one to demonstrate this).
That's odd, flex_basis is working for me. If you look at the screenshot at the top of the page, the bar is set to 75% using the flex-basis property. Does it not respond even with everything else set to Auto?
flex_basis is working for me as well.
@alice-i-cecile, you could try running cargo update to make sure you're on the latest taffy patch.
Ah, I didn't actually try it. I was just mentally simulating it. But I'd hallucinated a flex-grow: 1 in my mental model.
Working correctly now! I had to change only flex_basis while leaving other values to auto to see an effect :)