Skip to content
Discussion options

You must be logged in to vote

The 'size out of range' exception is because you are placing the scrollbar inside of the scrollable area. To make it work move outside of the Box(), but inside of the ScrollArea():

        val scrollState = rememberScrollState()
        ScrollArea(rememberScrollAreaState(scrollState)) {
            Column(Modifier.verticalScroll(scrollState)) { // <- replaced Box with Column so that the items are after each other
                items.forEachIndexed { i, option ->
                    Button(onClick = {}) {
                        Text(text = option)
                    }
                }
            }
            VerticalScrollbar( // <- this must not be inside of the Box

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@subchannel13
Comment options

@alexstyl
Comment options

@subchannel13
Comment options

@alexstyl
Comment options

Answer selected by subchannel13
@subchannel13
Comment options

@alexstyl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants