cursive icon indicating copy to clipboard operation
cursive copied to clipboard

ListView forcibly squishes any content to height 1

Open untitaker opened this issue 8 years ago • 5 comments

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?

untitaker avatar Apr 17 '17 16:04 untitaker

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.

gyscos avatar Apr 17 '17 17:04 gyscos

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 avatar Apr 17 '17 17:04 untitaker

@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 avatar Jul 25 '19 14:07 yashaslokesh

@yashaslokesh no, I did not want that. I just wanted to stack multiple form elements that might have a height bigger than 1.

untitaker avatar Aug 05 '19 15:08 untitaker

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.

namibj avatar Mar 02 '21 20:03 namibj