Skip to content

Content inside ModalBottomSheet or Dialog does not respect LocalLayoutDirection #192

@ddrb56

Description

@ddrb56

Describe your issue

The content lambda for ModalBottomSheet and Dialog do not follow the layout direction provided by LocalLayoutDirection. For now there is a work around by using:

CompositionLocalProvider(LocalLayoutDirection provides LocalLayoutDirection.current) {
    // content
}

What version of Compose Unstyled are you using?

1.49.6

What version of Compose are you using?

Compose Bom 2026.01.00

Which platforms can you reproduce the bug on?

Select one or multiple:

  • Android
  • iOS
  • Desktop (Windows, Linux, MacOS)
  • Web WASM
  • Web JS

Minimum reproducible code

    val sheetState = rememberModalBottomSheetState(SheetDetent.FullyExpanded)

    CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl) {
        ModalBottomSheet(
            state = sheetState,
            onDismiss = { sheetState.targetDetent = SheetDetent.Hidden }
        ) {
            Sheet {
                // Row won't follow RTL in this case
                Row(
                    modifier = Modifier.fillMaxWidth(),
                    verticalAlignment = Alignment.CenterVertically,
                    horizontalArrangement = Arrangement.SpaceBetween
                ) {
                    Text(text = "Left", color = Color.Black)
                    Text(text = "Right", color = Color.Black)
                }
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions