-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested Scroll Connaction blocks scrolling after upgrade to Compose Multiplatform 1.6.0 #4395
Comments
@Vaibhav2002 Android and Desktop is affected too? Are you sure that it's not iOS specific? |
I am facing this issue in iOS and Android. Dont know about desktop as my targets are ios and android only |
Thanks for clarification. We'll look into it, but at the same time, I'd recommend you to create this issue on Google's tracker too - if Android is affected, it means this related change was merged from AOSP repo to our fork. Also, Compose Multiplatform uses original Google's binaries on Android, so it requires Google's attention and fix too. Please post the link to that issue here that we can be in sync. Thanks |
@Vaibhav2002 , Hi there! I can't reproduce it on 1.6.0. I used your layout like this:
You can see the result below (same on Android Emulator): What should be changed there to make it reproducible? |
@ASalavei, I found out that this is happening only when we have a Horizontal Pager @OptIn(ExperimentalFoundationApi::class)
@Composable
fun ProfileTab() {
val tabs = 2
val pagerState = rememberPagerState(0) { tabs }
CollapsingLayout(
collapsingTop = {
Box(modifier = Modifier.fillMaxWidth().height(350.dp).background(Color.Green))
}
) {
HorizontalPager(
state = pagerState,
modifier = Modifier.fillMaxSize(),
) {
LazyColumn(modifier = Modifier.fillMaxWidth()) {
items(6) {
Box(
modifier = Modifier.fillMaxWidth().height(200.dp)
.background(MaterialTheme.colorScheme.primary)
)
Spacer(modifier = Modifier.height(16.dp))
}
}
}
}
} |
Sure, I will create an issue there too |
The source of problem is here (It is Compose change, so Android apps will definetely be affected as well): https://github.com/JetBrains/compose-multiplatform-core/blob/6b1cbe1bb844c7a0c0602031289b273431e58f28/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/pager/Pager.kt#L899 I can propose the following change for CMP, however I'm not aware the way Google will fix it: JetBrains/compose-multiplatform-core#1154 |
@ASalavei let's just upstream your fix |
Link to Google Issue Tracker |
@ASalavei Thanks for fixing this |
@Vaibhav2002 We're going to release 1.6.1 in ~2w, this fix should be included. But our changes will fix only the iOS side - we're NOT rebuilding Android and use redirection to original Google's binaries. |
Fix scroll interruption by Pager component when the scroll happens in perpendicular direction ## Proposed Changes Do not interrupt scrolling if it occurs in a perpendicular direction to the Pager. ## Testing Test: see description here: JetBrains/compose-multiplatform#4395 ## Issues Fixed Fixes: The bug on JetBrains/compose-multiplatform#4395
@Vaibhav2002 the fix was too late for the next patch on Google side, so it will be released only in ~2w. On our side, we decided to sync with it and do not ship the fix for iOS separately. It means that it won't be included to 1.6.1, but only to 1.6.2 Closing, as it was fixed |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Describe the bug
Nested Scroll connection seems to be dropping scroll events and stopping scroll in Compose Multiplatform 1.6.0
When downgrading, it works fine
Affected platforms
Select one of the platforms below:
If the bug is Android-only, report it in the Jetpack Compose tracker
Versions
Expected behavior
Before upgrading to Compose Multiplatform 1.6.0, my custom layout which uses a nested scroll connection worked pretty good
Screen_Recording_20240229_210718.mp4
Now after upgrading to Compose Multiplatform 1.6.0, without any change of code it broke and stops scroll when swiping
Screen_Recording_20240229_211010.mp4
Source Code:
The text was updated successfully, but these errors were encountered: