You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the embedded BottomSheetLayout with SheetBehaviors(allowOutsideInteraction = true) and skipPeeked = false, a slow pull-down from Expanded settles directly to Collapsed instead of settling to Peeked. This makes an embedded map/detail sheet dismiss after a short slow drag from full-screen.
Expected behavior
From Expanded, dragging down should settle to Peeked.
From Peeked, a further downward drag should settle to Collapsed.
While the sheet is Peeked, the content behind it should remain interactive.
Actual behavior
With allowOutsideInteraction = true, a short slow pull-down from Expanded goes straight to Collapsed.
With allowOutsideInteraction = false, the Expanded -> Peeked behavior is closer to expected, but the background can no longer be interacted with.
A fast downward flick also dismisses directly in both modes.
Reproduction
val state = rememberBottomSheetState(initialValue =BottomSheetValue.Peeked)
Box(modifier =Modifier.fillMaxSize()) {
Map() // background content that must remain interactive while peekedBottomSheetLayout(
state = state,
skipPeeked =false,
peekHeight =PeekHeight.fraction(0.2f),
behaviors =SheetBehaviors(allowOutsideInteraction =true),
) {
// detail content
}
}
From the fully expanded state, drag the sheet down slowly and release.
Root cause
Velocity tracking is coupled to allowOutsideInteraction. In CoreBottomSheetLayout, detectPointerPositionChanges is installed only in the allowOutsideInteraction == false branch:
A small slow downward offset from Expanded moves outside the peekTop..peekBottom band toward the larger offset side, so it becomes Collapsed.
Suggested fix
Decouple drag-velocity tracking from outside interaction. For example, track pointer position changes whenever either outside interaction is disabled or an explicit velocity/settling behavior is enabled, rather than tying velocity collection to the modal scrim branch. This would preserve background interactivity while still allowing Expanded -> Peeked -> Collapsed settlement.
Environment
Library: io.github.dokar3:sheets-m3:0.7.5
Layout: embedded BottomSheetLayout, non-modal, over an interactive map
Describe the bug
When using the embedded
BottomSheetLayoutwithSheetBehaviors(allowOutsideInteraction = true)andskipPeeked = false, a slow pull-down fromExpandedsettles directly toCollapsedinstead of settling toPeeked. This makes an embedded map/detail sheet dismiss after a short slow drag from full-screen.Expected behavior
Expanded, dragging down should settle toPeeked.Peeked, a further downward drag should settle toCollapsed.Peeked, the content behind it should remain interactive.Actual behavior
allowOutsideInteraction = true, a short slow pull-down fromExpandedgoes straight toCollapsed.allowOutsideInteraction = false, theExpanded -> Peekedbehavior is closer to expected, but the background can no longer be interacted with.Reproduction
From the fully expanded state, drag the sheet down slowly and release.
Root cause
Velocity tracking is coupled to
allowOutsideInteraction. InCoreBottomSheetLayout,detectPointerPositionChangesis installed only in theallowOutsideInteraction == falsebranch:https://github.com/dokar3/sheets/blob/main/sheets-core/src/commonMain/kotlin/com/dokar/sheets/CoreBottomSheetLayout.kt#L245-L277
When
allowOutsideInteraction = true, that branch returnsModifier, sostate.dragVelocityremains0f.With zero velocity,
BottomSheetState.nextValue()falls through to the position-only logic and ends at the default return value:https://github.com/dokar3/sheets/blob/main/sheets-core/src/commonMain/kotlin/com/dokar/sheets/BottomSheetState.kt#L502-L552
A small slow downward offset from
Expandedmoves outside thepeekTop..peekBottomband toward the larger offset side, so it becomesCollapsed.Suggested fix
Decouple drag-velocity tracking from outside interaction. For example, track pointer position changes whenever either outside interaction is disabled or an explicit velocity/settling behavior is enabled, rather than tying velocity collection to the modal scrim branch. This would preserve background interactivity while still allowing
Expanded -> Peeked -> Collapsedsettlement.Environment
io.github.dokar3:sheets-m3:0.7.5BottomSheetLayout, non-modal, over an interactive map