Skip to content

Commit

Permalink
Merge pull request #579 from Chen-Xi-g/fix-issue
Browse files Browse the repository at this point in the history
Fixed the issue where 'onPageSelected' was not being called during slow scrolling with 'HorizontalPager'.
  • Loading branch information
arkivanov committed Dec 18, 2023
2 parents 2dc8817 + 0e512d7 commit 8b16a1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fun <C : Any, T : Any> Pages(
}
}

DisposableEffect(state.currentPage) {
DisposableEffect(state.currentPage, state.targetPage) {
if (state.currentPage == state.targetPage) {
onPageSelected(state.currentPage)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fun <C : Any, T : Any> Pages(
}
}

DisposableEffect(state.currentPage) {
DisposableEffect(state.currentPage, state.targetPage) {
if (state.currentPage == state.targetPage) {
onPageSelected(state.currentPage)
}
Expand Down

0 comments on commit 8b16a1f

Please sign in to comment.