ListView forcibly squishes any content to height 1
When I tried to create a BoxView<TextArea> with fixed width inside a ListView, the ListView would ignore the required_size of BoxView. Is it intended that ListView only works with single-row content, and would you accept a PR that makes ListView vertically expand rows as required by content?
Hi!
Indeed, ListView currently only works with 1-height items (it was initially meant for forms).
A new, more general GridView is planned, which would accept children of any size, along with some extra features (inspired by the html <table> element). See #121.
It may take some time to get there however, and in the meantime you're more than welcome to expand the ListView.
Ok, now I ended up writing a wrapper around a bunch of nested LinearViews that comes close to what I want. I'll look into this later when I managed to get everything running.
@untitaker did you want a way to select between multiple views? Like a SelectView for choosing Views? If so, can I see your implementation?
@yashaslokesh no, I did not want that. I just wanted to stack multiple form elements that might have a height bigger than 1.
This has been fixed in 56008db7.
Children are now squished to their minimum height: child.required_size(size).y, with size coming from fn layout in the impl View for ListView.