VerticalFastScroller: Fix scroller consuming touch when it's invisible (#7484)

(cherry picked from commit 9385b86ecb92bd91e5ad65d0eed2580b6b4c6973)
This commit is contained in:
Ivan Iskandar 2022-07-09 20:20:47 +07:00 committed by Jobobby04
parent 72aba18dab
commit 2e881758aa

View File

@ -121,11 +121,10 @@ fun VerticalFastScroller(
.offset { IntOffset(0, thumbOffsetY.roundToInt()) }
.then(
// Recompose opts
if (!listState.isScrollInProgress) {
if (isThumbVisible && !listState.isScrollInProgress) {
Modifier.draggable(
interactionSource = dragInteractionSource,
orientation = Orientation.Vertical,
enabled = isThumbVisible,
state = rememberDraggableState { delta ->
val newOffsetY = thumbOffsetY + delta
thumbOffsetY = newOffsetY.coerceIn(thumbTopPadding, thumbTopPadding + trackHeightPx)