Assigned
Status Update
Comments
ja...@icloud.com <ja...@icloud.com> #2
Also getting this bug. Same cause. BottomSheetScaffold steals scroll event from LazyColumn when there is a small gap between two successive scroll events. Scroll events overlapping or scroll events far apart from each other tend to be ok.
ma...@google.com <ma...@google.com> #3
Possible duplicate:
ma...@gmail.com <ma...@gmail.com> #4
It is not duplicate. Both belong to different libraries. This one is from M2 while other one is from M3.
BottomSheetScaffold from M3 is not ideal solution since that version lack exposed state(s) needed to determine progress when opening/closing (x% opened), which is crucial for animation.
Without that, M3 version is not a valid replacement for M2 version.
ku...@adobe.com <ku...@adobe.com> #5
Is there any workaround on this?
ma...@gmail.com <ma...@gmail.com> #6
It is possible to mitigate bug but never completely.
Most important thing for it is animationSpec in rememberBottomSheetState().
Lowering durationMillis for animations like tween(), or changing it to something like spring() can somewhat help.
Alternatively Material3 version of BottomSheetScaffold can help to those who are fine with only basic functionality.
But as far as I have noticed even M3 version have that bug, but it is less frequent.
Most important thing for it is animationSpec in rememberBottomSheetState().
Lowering durationMillis for animations like tween(), or changing it to something like spring() can somewhat help.
Alternatively Material3 version of BottomSheetScaffold can help to those who are fine with only basic functionality.
But as far as I have noticed even M3 version have that bug, but it is less frequent.
Description
There is a bug with BottomSheetScaffold that cause it to steal event from LazyColumn and close itself while scrolling through LazyColumn. Bug is maybe tied to animationSpec of BottomSheetState, because longer animation duration is increasing while shorter duration is decreasing frequency of bug occurring.
Jetpack Compose version(s): Tested with multiple stable 1.7.x versions
Material Library Version (M2, M3 or Both?): M2
Material Compose component used: BottomSheetScaffold, BottomSheetState, LazyColumn
Android Studio Build(s): Koala | 2024.1.1, Ladybug | 2024.2.1
Kotlin version(s): 1.9.0, 2.1.0
Steps to Reproduce or Code Sample to Reproduce: Bug can be reproduced if multiple scroll events are performed (WITHOUT FLICKING!) in quick succession (delay between end of first and start of second event is important). If performed correctly BottomSheetScaffold will steal event and close itself (it usually occur on second scroll event).
In demo LazyColumn is placed in sheetContent of BottomSheetState which default state is set to extended and is scrolled to last item. Since frequency of bug depend on animation duration, it is increased to 1000ms so it can be replicated with more ease.
Beside that bug there is also a occasional crash happening while scrolling through LazyColumn in that same scenario.