Skip to content

How to add scrollBar to dropdownMenu? #559

Answered by akurasov
Exidel asked this question in Q&A
Discussion options

You must be logged in to vote

The issue is the following:
Box with modifier verticalScroll should be on the same level as VerticalScrollbar itself. Otherwise scroll scroll itself. But of course, we it shouldn't crash like this. I'll create a ticket about it (#1616).

Below is your code corrected.

@Composable
@Preview
fun App() {
    val listState = rememberScrollState(0)
    Box(
        modifier = Modifier
            .background(color = Color(180, 180, 180))
    ) {
        Box(
            modifier = Modifier
                .fillMaxSize()
                .verticalScroll(listState)
                .padding(end = 12.dp, bottom = 12.dp)) {
        }

        VerticalScrollbar(
            adapter = rememberScrollbarAd…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@svercl
Comment options

Comment options

You must be logged in to vote
1 reply
@svercl
Comment options

Comment options

You must be logged in to vote
4 replies
@svercl
Comment options

@akurasov
Comment options

@svercl
Comment options

@akurasov
Comment options

Answer selected by akurasov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants