I have a question. In regards to Paging3 with Comp...
# compose-android
s
I have a question. In regards to Paging3 with Compose If pageSize is set X value and then i click on X + 1 or X + n item and navigate away and then on navigate back to it and call refresh on the paging ite,s, it moves to the beginning of the page Okay ik its getting confusing Example: Lets take our pageSize is 15. And my screen can display like 6-7 items. and the 16th item is like on screen showing up with the items from page 1 and page 2 as i click the 16th item and navigate away and come back to call refresh on the pagingItems. The scroll jumps to the previous page content or the same page last content regardless of where the actual scroll position was. I know the issue stems from the getRefreshKey function. (Vanilla implementation) But what am i doing wrong?
Copy code
override fun getRefreshKey(state: PagingState<Int, FarmerList.Farmer>): Int? =
    state.anchorPosition?.let { anchorPosition ->
        state.closestPageToPosition(anchorPosition)?.prevKey?.plus(1) ?: state.closestPageToPosition(anchorPosition)?.nextKey?.minus(1)
    }
https://issuetracker.google.com/issues/177245496 I know about this issue and have implemented the workaround too But my question slightly differs from it.