Issue using Column in ListView delegate
GuyInCorner opened this issue · 3 comments
I have noticed an issue with using a column in a ListView delegate.
The listView shows extra space at the end of the view.
This can end up being so much extra space that in some cases the list appears empty because all the content has scrolled off the top.
Here is a simple test case. There are two delegate options.
RectDeleg1 uses a Rectangle that changes height when clicked and all is fine.
RectDeleg2 uses a Column that changes visibility of child items when clicked and the ListView is messed up.
The one work-around is to set the height to all the children in the column to 0 when hidding, but this isn't practical in the real use.
listviewExpand.tar.gz
Thanks for the repro!
The problem there is that you're using visible
property inside scrolling surface. So your rectangle just keep its geometry, but just skips rendering.
The alternative to visible property could be declaring your own property and call this.style('display', this.myVisible? "block": "none"))
Feel free to reopen it if you feel it's not resolved
Rectangle {
width: parent.width;
height: parent.childHeight;
color: "orange";
onRecursiveVisibleChanged: {
log("orange visible ", value)
this.style('display', value? 'block': 'none')
}
}