JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.26k stars 1.18k forks source link

No Access to `DropDownMenu` or `AlertDialog` in common source set #762

Closed ScottPierce closed 1 year ago

ScottPierce commented 3 years ago

We currently can't access the DropDownMenu or AlertDialog from the common source set for compose. Someone mentioned this was because of PopupProperties.

igordmn commented 3 years ago

For DropDownMenu we can create a common function in commonMain:

fun DropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    offset: DpOffset = DpOffset(0.dp, 0.dp),
    content: @Composable ColumnScope.() -> Unit
)
avently commented 3 years ago

@igordmn could you do the same for AlertDialog? it will help in my situation too (at least for AlertDialog), see https://github.com/JetBrains/compose-jb/issues/758

atsushieno commented 3 years ago

What is blocking you from adding DropdownMenu as an expect declaration?

francismariano commented 1 year ago

Is there some milestone for this issue?? Access AlertDialog and DropDownMenu from common sources set sounds great.

compose-android // compose-ios // compose-desktop // compose-web

atsushieno commented 1 year ago

I don't expect that to happen, because Jetpack Compose API is not designed to be cross platform here. It should be Google who should fix the issue.

So far I have built a workaround package a while ago, to the rescue: https://github.com/atsushieno/compose-mpp

MatkovIvan commented 1 year ago

It was released in 1.5.0

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.