Alexander Maryanovsky
03/25/2022, 7:28 AMval scrollbarAdapter = rememberScrollbarAdapter(state)
// We check before adding it because VerticalScrollbar always stretches the containing box to fill the entire
// available space. Even if we add BoxScope.matchParentSize to its modifier.
if (showVerticalScrollbar && (scrollbarAdapter.maxScrollOffset(containerHeight) > 0)){
VerticalScrollbar(
adapter = scrollbarAdapter,
reverseLayout = reverseLayout,
modifier = Modifier.align(Alignment.CenterEnd)
)
}
But due to the call to maxScrollOffset
this keeps recomposing continuously, taking around 50% cpu time, and apparently even leaks memory, because eventually the app crashes on OutOfMemoryError