Skip to content

Commit 610db52

Browse files
committed
library: Fix issue that the input method can't raise dialog
1 parent c68238e commit 610db52

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

composeApp/src/commonMain/kotlin/component/TextComponent.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import top.yukonga.miuix.kmp.basic.Checkbox
3535
import top.yukonga.miuix.kmp.basic.SmallTitle
3636
import top.yukonga.miuix.kmp.basic.Switch
3737
import top.yukonga.miuix.kmp.basic.Text
38+
import top.yukonga.miuix.kmp.basic.TextField
3839
import top.yukonga.miuix.kmp.extra.CheckboxLocation
3940
import top.yukonga.miuix.kmp.extra.SuperArrow
4041
import top.yukonga.miuix.kmp.extra.SuperCheckbox
@@ -263,6 +264,7 @@ fun TextComponent() {
263264

264265
@Composable
265266
fun dialog(showDialog: MutableState<Boolean>) {
267+
val value = remember { mutableStateOf("") }
266268
showDialog(
267269
show = showDialog.value,
268270
content = {
@@ -274,6 +276,13 @@ fun dialog(showDialog: MutableState<Boolean>) {
274276
showDialog.value = false
275277
},
276278
) {
279+
TextField(
280+
modifier = Modifier.padding(bottom = 16.dp),
281+
value = value.value,
282+
backgroundColor = MiuixTheme.colorScheme.secondary,
283+
maxLines = 1,
284+
onValueChange = { value.value = it }
285+
)
277286
Row(
278287
horizontalArrangement = Arrangement.SpaceBetween
279288
) {

miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDialog.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.compose.foundation.gestures.detectTapGestures
55
import androidx.compose.foundation.layout.Column
66
import androidx.compose.foundation.layout.fillMaxSize
77
import androidx.compose.foundation.layout.fillMaxWidth
8+
import androidx.compose.foundation.layout.imePadding
89
import androidx.compose.foundation.layout.padding
910
import androidx.compose.foundation.layout.widthIn
1011
import androidx.compose.runtime.Composable
@@ -69,6 +70,7 @@ fun SuperDialog(
6970

7071
Box(
7172
modifier = Modifier
73+
.imePadding()
7274
.fillMaxSize()
7375
.pointerInput(Unit) {
7476
detectTapGestures(onTap = {

0 commit comments

Comments
 (0)