Skip to content

Commit

Permalink
Merge pull request #1264 from ShikaSD/main
Browse files Browse the repository at this point in the history
[Pager] Remember nested connection in Pager component
  • Loading branch information
andkulikov committed Jul 25, 2022
2 parents f619020 + d04d6bc commit c5e9571
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pager/src/main/java/com/google/accompanist/pager/Pager.kt
Expand Up @@ -381,10 +381,12 @@ internal fun Pager(

// We only consume nested flings in the main-axis, allowing cross-axis flings to propagate
// as normal
val consumeFlingNestedScrollConnection = ConsumeFlingNestedScrollConnection(
consumeHorizontal = !isVertical,
consumeVertical = isVertical,
)
val consumeFlingNestedScrollConnection = remember(isVertical) {
ConsumeFlingNestedScrollConnection(
consumeHorizontal = !isVertical,
consumeVertical = isVertical,
)
}

if (isVertical) {
LazyColumn(
Expand Down

0 comments on commit c5e9571

Please sign in to comment.