Closed curioustechizen closed 1 year ago
Thank you, but we are not planning updatinf the documentation for the deprecated library, as instead we recommend migrating to the Pager from foundation library, where there is no this issue, as you mentioned
Description
This documentation recommends simply using
currentPage
to react to page changes. However, this is not functionally equivalent to Foundation Pager'ssettledPage
API. Specifically, you often want to react to page changes only when a page has settled.Since Pager is now deprecated, instead of providing an equivalent of the
settledPage
API, would you consider updating the above documentation with a code snipper that simulated the settledPage API?Additional context
This difference in functionality between Accompanist Pager and Foundation Pager can have real-world consequences. Specifically, it led to a bug in Accompanist pager where a button on pages would not receive tap events (instead the pager would try to perform a DragInteraction) immediately after doing a programmatic
scrollToPage
.Here is some code to demonstrate the problem
With this code, if you scroll to a page and then try to tap the Play button, nothing happens. You need to tap twice for it to take effect.
The problem can be fixed by simulating the
settledPage
API as followsThe problem does not occur while using Foundation pager