Skip to content

Commit a7e76eb

Browse files
authored
Merge pull request #443 from JetBrains/ios-scroll-to-top-fix
Fix unnecessary scrolls-to-top
2 parents 3993fc3 + 20eaab6 commit a7e76eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shared/src/iosMain/kotlin/org/jetbrains/kotlinconf/ScrollToTopHandler.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,16 @@ private fun createDelegate(
7979
scrollingToTop = false
8080
}
8181

82+
private var firstScroll = true
8283
private var scrollingToTop = false
8384
private var lastKnownOffset = 1.0
8485

8586
// Sync from Native to Compose
8687
override fun scrollViewDidScroll(scrollView: UIScrollView) {
88+
if (firstScroll) {
89+
firstScroll = false
90+
return
91+
}
8792
if (scrollingToTop) {
8893
return
8994
}

0 commit comments

Comments
 (0)