Hi all, this question is related to material3 specifically.. (pressed enter by accident, still editing)
We've implemented a material3 ModalBottomSheet and are passing in the container colour via the theme, like so
ModalBottomSheet(
onDismissRequest = onDismissRequest,
modifier = modifier,
sheetState = sheetState,
shape = RoundedCornerShape(topStart = DP_8, topEnd = DP_8),
containerColor = MaterialTheme.colorScheme.surface,
dragHandle = dragHandle,
content = {
content()
Spacer(modifier = Modifier.navigationBarsPadding())
}
)
nothing weird, right? but the
surface
colour doesnt seem to be applying, even though elsewhere on that screen
surface
is applied correctly on another Composable
furthermore, hardcoding containerColour to another colour actually makes it apply, and we are having a very similar issue in a dialog
fun CustomDialog() {
Dialog {
Surface(
color = MaterialTheme.colorScheme.surface // colour does not apply, unless it is changed to be hardcoded
)
}