Alex Styl
10/25/2025, 10:16 AMNestedScrollConnection events (see 1st video)
• On Desktop however, I don't receive any events when i overscroll (see video in 🧵).
I need this to be consistent because I am building bottom sheets and users cannot currently collapse them on desktop using the mousewhee/trackpad. The current behavior is so weird for UX and doesn't feel I (the dev) need to handle this a different way.
If this somehow a limitation of the platform, the web platform (Compose) handles it the same way. But on macs, desktop lists do bounce (overscroll effect) and websites (html) bounce as well.Alex Styl
10/25/2025, 10:17 AMAlex Styl
10/25/2025, 10:18 AM@Composable
fun MinimalNestedScrollBugRepro() {
// Minimal reproducible example for nested scroll bug
// Issue: On desktop with mouse wheel, scrolling down doesn't work when at fully expanded state
// Works fine on Android touch
val density = LocalDensity.current
var totalDelta by remember { mutableStateOf(0f) }
val nestedScrollConnection = remember {
object : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
if (source != NestedScrollSource.UserInput) return Offset.Zero
totalDelta += available.y
return Offset.Zero
}
}
}
Box(
Modifier
.fillMaxSize()
.safeDrawingPadding()
.background(Color(0xFFEEEEEE))
) {
Text("Total delta = $totalDelta", modifier = Modifier.padding(16.dp))
// Sheet
Column(
Modifier
.align(Alignment.BottomCenter)
.height(600.dp)
.nestedScroll(nestedScrollConnection)
.verticalScroll(rememberScrollState())
.padding(16.dp)
) {
repeat(100) { index ->
Box(
Modifier
.fillMaxWidth()
.height(60.dp)
.background(Color.LightGray, RoundedCornerShape(8.dp))
.padding(16.dp)
) {
Text("Item $index")
}
Spacer(Modifier.height(8.dp))
}
}
}
}Alex Styl
10/26/2025, 8:04 AMAlex Vanyo
10/27/2025, 5:10 PMAlex Vanyo
10/27/2025, 5:33 PMAlex Styl
10/28/2025, 12:34 AM