I’m trying to work around this bug: <https://githu...
# compose-desktop
a
I’m trying to work around this bug: https://github.com/JetBrains/compose-jb/issues/1916 like so:
Copy code
val 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