My compose UI scrolls smoothly when going down, bu...
# compose
f
My compose UI scrolls smoothly when going down, but not smooth when scrolling up. Any ideas? (Tested on WasmJS and Desktop)
1
no smooth scroll.mov
s
Any chance it's the images taking up 0.dp on the first frame, and then the image cache is hit, making it take up the right size, but as you are going up it pushes everything a bit further down, giving you this behavior? If you make the cards always have a fixed size, even when the placeholder is still showing, does it behave the same?
f
Thanks for the suggestion! I’ll try giving it a fixed size; Seems I used a range, instead of a fixed size.
Copy code
Box(modifier = Modifier.heightIn(50.dp, 150.dp)) {
s
Yeah, I suggest a fixed height just to see if this is in fact what makes this happen. I don't know either, it's an assumption😁
Important that the height is the same when the image does in fact load too.
f
That fixed the issue! The scrolling is now smooth 😄 thank you color
🦠 2
The Image would be contained within that Box; So even if the image is not loaded yet, the Box would be the same size 🙂
👍 1