Hello :wave: Does anyone have tips on how to make ...
# compose
g
Hello 👋 Does anyone have tips on how to make an auto-scrollable LazyRow in compose where you can click the items inside?
Copy code
val listState = rememberLazyListState(
    initialFirstVisibleItemIndex = startAtPosition?.firstVisibleItemIndex ?: state.plans.size,
    initialFirstVisibleItemScrollOffset = startAtPosition?.firstVisibleItemScrollOffset ?: 0
  )

  val interactionState = listState.interactionSource.interactions.collectAsState(initial = null)

  LaunchedEffect(key1 = interactionState.value) {
    when (interactionState.value) {
      is DragInteraction.Stop -> while (listState.isScrollInProgress) delay(200)
      null -> Unit
      else -> return@LaunchedEffect
    }

    while (isActive) {
      listState.scroll(scrollPriority = MutatePriority.UserInput) {
        scrollBy(1f)
        delay(30)
      }
    }
  }
This is the current setup I have for the auto-scroll part which is fairly straightforward but since the last compose update (1.1.1) I can’t click the items inside. When I click an item the scroll simply stops because it counts as the start of the Drag gesture for the LazyRow and not the click for the item, I feel like the hierarchy of events should be the reverse of that. Does anyone have a tip on how to implement this or has had similar issues with a LazyRow/Column? Thanks in advance 🙌
🤔 1