Hello does anyone know how the `show()` method sho...
# compose-android
f
Hello does anyone know how the
show()
method should be used in order to animate the Material3
ModalBottomSheet
? It seems that right now there is a bug that prevents the animation from working and even the official sample uses a boolean instead to open it: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]java/androidx/compose/material3/samples/BottomSheetSamples.kt
Code to test this easily:
Copy code
val sheetState = rememberModalBottomSheetState()
val scope = rememberCoroutineScope()

Button(onClick = {
    scope.launch {
        sheetState.show()
    }
}) {
    Text("Show sheet")
}
if (sheetState.isVisible) {
    ModalBottomSheet(
        sheetState = sheetState,
        onDismissRequest = {
            scope.launch {
                sheetState.hide()
            }
        },
    ) {
       // content
    }