Skip to content

Commit

Permalink
fix: [ANDROAPP-6579] add DpOffset as parameter for dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Dec 9, 2024
1 parent 1da672c commit 21734a8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -16,6 +18,7 @@ fun <T> DropDownMenu(
modifier: Modifier = Modifier,
items: List<MenuItemData<T>>,
expanded: Boolean = false,
offset: DpOffset = DpOffset(0.dp, 0.dp),
selectedItemIndex: Int? = null,
onDismissRequest: () -> Unit,
onItemClick: (T) -> Unit,
Expand All @@ -27,6 +30,8 @@ fun <T> DropDownMenu(
.widthIn(min = 270.dp),
expanded = expanded,
onDismissRequest = onDismissRequest,
offset = offset,
properties = PopupProperties(clippingEnabled = false),
) {
items.forEachIndexed { index, item ->
MenuItem(
Expand Down

0 comments on commit 21734a8

Please sign in to comment.