https://kotlinlang.org logo
#compose
Title
# compose
v

Vitaliy Zarubin

05/26/2021, 4:11 PM
Please tell me where to dig the position of the list is not saved Paging 3.0 + paging-compose. PageSource ViewModel LazyColumn
a

Andrey Kulikov

05/26/2021, 4:26 PM
most probably the issue is with the fact that the scroll is restored while the paging didn’t yet load the items as the items are loaded asynchronously. while we don’t have something similar to this in compose you can workaround it with not emitting LazyColumn at all while there are no items in LazyPagingItems. something like
if (model.itemCount == 0) { LoadingItem() } else { LazyColumn(…) }
1
🙏 1
v

Vitaliy Zarubin

05/26/2021, 4:35 PM
@Andrey Kulikov It works. Thank you.
v

Vipulyaara

05/26/2021, 8:36 PM
This issue might also be helpful https://issuetracker.google.com/issues/177245496
🙏 1
2 Views