Skip to content

Commit

Permalink
Use UserInput over deprecated Drag
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed Oct 26, 2024
1 parent 49ad6f5 commit f5fb57e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/commonMain/kotlin/ScrollArea.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fun ScrollArea(
Box(modifier.nestedScroll(remember {
object : NestedScrollConnection {
override fun onPostScroll(consumed: Offset, available: Offset, source: NestedScrollSource): Offset {
if (source == NestedScrollSource.Drag && overscrollEffect != null) {
if (source == NestedScrollSource.UserInput && overscrollEffect != null) {
// they are scrolling past a dead-end
// forward to overscrollEffect's direction they are trying to go

Expand Down Expand Up @@ -129,7 +129,7 @@ fun ScrollArea(
scope.launch {
scrollEvents.emit(Unit)
}
if (source == NestedScrollSource.Drag && overscrollEffect != null) {
if (source == NestedScrollSource.UserInput && overscrollEffect != null) {
// they have already started scrolling
// forward to overscrollEffect's opposite direction they are trying to go

Expand Down

0 comments on commit f5fb57e

Please sign in to comment.