While working with a `LazyColumn` with a `Vertical...
# compose-desktop
s
While working with a
LazyColumn
with a
VerticalScrollBar
, i’m using
rememberScrollbarAdapter
as the adapter and it requires
averageItemSize
. I could imagine this works fine when the items are expected to be the same size. How do i handle the case when items might not be the same size. Is there an alternative i might have missed?
c
This is still an open issue: https://github.com/JetBrains/compose-jb/issues/181 I had a similar question. the workaround mentioned sorta worked though I’m still having issues with the scrollbar not being able to scroll up properly with drag-and-drop
🙌 1
Though my issue was with
stickyHeader
which is experimental, but can cause the issue of the
averageItemSize
not being uniform
s
I also have the exact same usecase and behaviour you have, the
CustomScrollAdapter
worked perfect with the mouse wheel though, thanks 🙏
c
Yeah mouse wheel worked fine. But I want the dragging to work at some point
1
d
You're welcome. 😛🙂
🌟 1
🙏 1
😄 2
s
Yeah i would also like the dragging to work, one thing i noticed that seems to cause this “resistance” behaviour, is that the
averageItemSize
has a relatively big change once the first item in the list(below the sticky header) gets to the top of the sticky header (happens while scrolling). This seems to cause the scroll bar to change its height, atleast in my case. Once the height has been changed, there is no more “resistance”. thanks Dominic btw 😄
y
In regards to the
averageItemSize
issue, I fixed mine by not using a
LazyColumn
for now. If I end up bumping into performance issue I will split into multiple "pages". In my case I have a list of cards that can be individually expanded and so it is a total mess with
LazyColumn
and scrollbar...
c
Yeah I may try that with some paging. Currently, the amount of items I have are in the thousands so I think
Column
would break down there. But I don’t do any paging on the data structure