How to fix the scroll of a List View that contains items with different size?

Does anyone have any idea how to properly control the scroll of a list view that contains items of varying sizes?

I have a plugin and a sample project that use Slate and UMG, respectively, and both have the same problem: if the list view contains items of different sizes, it has a completely crazy scroll.

I haven’t been able to figure out how to fix this yet, but does anyone who has experienced this have a solution or recommendation for another component to list messages like a chat?

Please watch the video and pay close attention to the scroll (sorry if the first video is hard to see because there is a lot of white):

It is noticeable that the scroll changes size depending on the visible item, and with Slate it is worse, sometimes I can’t scroll to the end because the size difference blocks navigation.

Would another element be ideal for this case instead of a List View?

1 Like

Hi @lucoiso

I believe this has to do with the underlying nature of List views.

A list view is basically an optimized scrollbox, where it use as few elements in the list as possible, to display the elements in view.

When an element in a ListView leaves the view, it is “freed up” for use with another entry that enters the view.

Because of this, I think the scrollbar in a ListView, assumes the default size of each widget element, but when an element comes into view which affects the default size of the widget it uses, the scrollbar has to adjust on the spot.

TL;DR If you don’t have hundreds/thousands of elements in your list, you probably don’t need to use a ListView, and can just use a ScrollBox.

Hope this helps :slight_smile:

Whooo, thanks! I’ll try using a scroll box as the elements count is limited! : )

Thanks @KyleRyanBlowfish !

The scroll box works perfectly! :star_struck:

1 Like