Skip to content

Commit

Permalink
Fixed the issue where 'onPageSelected' was not being called during sl…
Browse files Browse the repository at this point in the history
…ow scrolling with 'HorizontalPager'.
  • Loading branch information
Chen-Xi-g committed Dec 18, 2023
1 parent 2dc8817 commit 0e512d7
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 0e512d7

Please sign in to comment.