Skip to content

Thumb in the Scrollbar ignores animations if an offset is applied to the Thumb #197

Description

@kend1e

Describe your issue

The thumb in the scrollbar disappears and reappears immediately after the delay, ignoring the exit and enter parameters inside ThumbVisibility.HideWhileIdle, if an offset is applied to the Thumb.

What version of Compose Unstyled are you using?

For example: 1.49.6

What version of Compose are you using?

CMP 1.11.0-alpha02

Minimum reproducible code

  val lazyListState = rememberLazyListState()
  val state = rememberScrollAreaState(lazyListState)

  ScrollArea(
      state = state
  ) {
      LazyColumn(
          state = lazyListState
      ) {
        repeat(50) { i ->
            item {
                Text("Item #${i}")
            }
        }
      }
      VerticalScrollbar(
          modifier = Modifier
              .align(Alignment.CenterEnd)
              .fillMaxHeight()
              .width(8.dp)
          ,
      ) {
          Thumb(
              modifier = Modifier
                  .offset {
                      val px = ((8.dp + 16.dp) * 0.5f).roundToPx()
                      IntOffset(px, 0)
                  }
                  .background(
                      color = Color.White
                  ),
            thumbVisibility = ThumbVisibility.HideWhileIdle(
                enter = fadeIn(),
                exit = fadeOut(),
                hideDelay = 2.seconds
            )
          )
      }
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked by GoogleThis issue is cannot be resolved until a specific bug or issue in Jetpack Compose is resolved.bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions