I have implemented a bottom sheet and it expands o...
# compose
r
I have implemented a bottom sheet and it expands once the screen is opened. Problem is, sheet slides from the top of the screen instead of bottom, please see the video. Any clue for what I'm doing wrong?
Copy code
val bottomSheetScaffoldState = rememberBottomSheetScaffoldState(
    bottomSheetState = rememberBottomSheetState(
        initialValue = BottomSheetValue.Expanded,
        animationSpec = tween(durationMillis = 500, delayMillis = 100),
    )
)

Surface(
    color = MaterialTheme.colors.primary
) {
    BottomSheetScaffold(
        sheetShape = RectangleShape,
        backgroundColor = MaterialTheme.colors.primary,
        bottomSheetScaffoldState = bottomSheetScaffoldState,
        sheetPeekHeight = 0.dp,
        sheetGesturesEnabled = false,
        sheetContent = { DialPadContent(viewModel, scaffoldState) },
    ) {
        // Screen content
    }
}
j
This is a bug in BottomSheetScaffold. Is your content dynamic by chance?
See https://issuetracker.google.com/issues/178492940 for the issue Quoting Matvei:
Sorry for the delays. I don't think we will be able to provide a solid fix for this soon. Given that it is experimental, I'd rather not hot-fix this, but invest some time in the proper redesign of the swipeable
Hoping to get something done on this soon-ish, but the ugly workaround might be your best option for now 😞
r
No, the sheet content isn't dynamic. I will explore other options, thank you.