Has anyone had luck making a Material3 `BottomShee...
# compose
m
Has anyone had luck making a Material3
BottomSheetScaffold
just act normal? I can't find any combination of
sheetPeekHeight
,
scaffoldState
and
skipHiddenState
that give you a normal behaviour (note: I'm not looking for a modal sheet). The bottom sheet should: 1. Begin hidden (or not even in the Composition, if need be?) 2. Open to a half a partially expanded height of 400dp I can set - I'm assuming through
sheetPeekHeight
- after I click something 3. Can be dragged to fully expanded 4. Can be hidden by dragging closed, pressing a close button, or tapping outside the bottomsheet At the moment I can achieve everything, except the peek height is always 0dp or always 400dp, depending on the initial value. I've tried using
derivedStateOf
for the peek height but that's not working either 🤔
Copy code
val peekHeight by remember {
            derivedStateOf {
                // Neither of these work
                if (viewState.selectedChat != null) 400.dp else 0.dp
                if (bottomSheetScaffoldState.bottomSheetState.currentValue == SheetValue.PartiallyExpanded) 400.dp else 0.dp
            }

        BottomSheetScaffold(
            scaffoldState = bottomSheetScaffoldState,
            sheetPeekHeight = peekHeight,
            sheetContent = {
                viewState.selectedChat?.let { chat ->
                    ChatDetailsBottomSheetContent()
                }
            },
            content = { }
        )
Nevermind... updating the library version from 1.2.1 to 1.3.0-beta03 fixes it. It must have been a library bug 💀