diff --git a/sample/shared/src/androidMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.android.kt b/sample/shared/src/androidMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.android.kt deleted file mode 100644 index fdc2143..0000000 --- a/sample/shared/src/androidMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.android.kt +++ /dev/null @@ -1,25 +0,0 @@ -package by.overpass.treemapchart.sample.shared.complex - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.input.key.KeyEvent -import androidx.compose.ui.unit.IntOffset -import androidx.compose.ui.window.Popup - -@Suppress("LongParameterList") -@Composable -internal actual fun FocusablePopup( - alignment: Alignment, - offset: IntOffset, - onDismissRequest: (() -> Unit)?, - onPreviewKeyEvent: ((KeyEvent) -> Boolean), - onKeyEvent: ((KeyEvent) -> Boolean), - content: @Composable () -> Unit, -) { - Popup( - alignment = alignment, - offset = offset, - onDismissRequest = onDismissRequest, - content = content, - ) -} diff --git a/sample/shared/src/commonMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.kt b/sample/shared/src/commonMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.kt index 6d570ef..17c770a 100644 --- a/sample/shared/src/commonMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.kt +++ b/sample/shared/src/commonMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.kt @@ -2,16 +2,24 @@ package by.overpass.treemapchart.sample.shared.complex import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment -import androidx.compose.ui.input.key.KeyEvent import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.window.Popup +import androidx.compose.ui.window.PopupProperties -@Suppress("LongParameterList") @Composable -internal expect fun FocusablePopup( +internal fun FocusablePopup( alignment: Alignment = Alignment.TopStart, offset: IntOffset = IntOffset(0, 0), onDismissRequest: (() -> Unit)? = null, - onPreviewKeyEvent: ((KeyEvent) -> Boolean) = { false }, - onKeyEvent: ((KeyEvent) -> Boolean) = { false }, content: @Composable () -> Unit, -) +) { + Popup( + alignment = alignment, + offset = offset, + onDismissRequest = onDismissRequest, + properties = PopupProperties( + focusable = true, + ), + content = content, + ) +} diff --git a/sample/shared/src/nonAndroidMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.nonAndroid.kt b/sample/shared/src/nonAndroidMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.nonAndroid.kt deleted file mode 100644 index 6904310..0000000 --- a/sample/shared/src/nonAndroidMain/kotlin/by/overpass/treemapchart/sample/shared/complex/FocusablePopup.nonAndroid.kt +++ /dev/null @@ -1,28 +0,0 @@ -package by.overpass.treemapchart.sample.shared.complex - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.input.key.KeyEvent -import androidx.compose.ui.unit.IntOffset -import androidx.compose.ui.window.Popup - -@Suppress("LongParameterList") -@Composable -internal actual fun FocusablePopup( - alignment: Alignment, - offset: IntOffset, - onDismissRequest: (() -> Unit)?, - onPreviewKeyEvent: ((KeyEvent) -> Boolean), - onKeyEvent: ((KeyEvent) -> Boolean), - content: @Composable () -> Unit, -) { - Popup( - alignment = alignment, - offset = offset, - focusable = true, - onDismissRequest = onDismissRequest, - onPreviewKeyEvent = onPreviewKeyEvent, - onKeyEvent = onKeyEvent, - content = content, - ) -}