From 21734a8d9cec86ff167be1ec446e48b749e14d71 Mon Sep 17 00:00:00 2001 From: Xavier Molloy Date: Mon, 9 Dec 2024 15:20:32 +0100 Subject: [PATCH] fix: [ANDROAPP-6579] add DpOffset as parameter for dropdown menu --- .../mobile/ui/designsystem/component/menu/DropDownMenu.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/menu/DropDownMenu.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/menu/DropDownMenu.kt index 062a6629e..f36859e58 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/menu/DropDownMenu.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/menu/DropDownMenu.kt @@ -6,7 +6,9 @@ import androidx.compose.material3.DropdownMenu import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.PopupProperties import org.hisp.dhis.mobile.ui.designsystem.theme.DHISShapes import org.hisp.dhis.mobile.ui.designsystem.theme.Shape import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor @@ -16,6 +18,7 @@ fun DropDownMenu( modifier: Modifier = Modifier, items: List>, expanded: Boolean = false, + offset: DpOffset = DpOffset(0.dp, 0.dp), selectedItemIndex: Int? = null, onDismissRequest: () -> Unit, onItemClick: (T) -> Unit, @@ -27,6 +30,8 @@ fun DropDownMenu( .widthIn(min = 270.dp), expanded = expanded, onDismissRequest = onDismissRequest, + offset = offset, + properties = PopupProperties(clippingEnabled = false), ) { items.forEachIndexed { index, item -> MenuItem(