youssef hachicha
10/01/2025, 11:16 AMDialog in a Compose Multiplatform project. When the soft keyboard appears, the dialog UI becomes shaky, as if the focused field try to repeatedly repositioning itself. This happens consistently in Android, even with various windowSoftInputMode settings. I suspect the issue is related to Dialog as windowSoftInputMode does not apply to a dialog's separate window on Android.
Code to reproduce in 🧵youssef hachicha
10/01/2025, 11:17 AM@Composable
fun CodeToReproduce() {
var value by remember { mutableStateOf("") }
Dialog(
onDismissRequest = {},
properties = DialogProperties(usePlatformDefaultWidth = false)
) {
Column(
modifier = Modifier
.fillMaxSize(0.95f)
.clip(MaterialTheme.shapes.large)
.background(MaterialTheme.colorScheme.surface)
.padding(8.dp)
.verticalScroll(rememberScrollState())
.imePadding()
) {
TextField(value = "Text Field 1", onValueChange = {})
TextField(value = "Text Field 2", onValueChange = {})
repeat(20) {
Text(text = "Item $it", modifier = Modifier.padding(16.dp))
}
TextField(value = value, onValueChange = {value = it})
TextField(value = "Text Field 4", onValueChange = {})
}
}
}youssef hachicha
10/01/2025, 11:17 AMyoussef hachicha
10/01/2025, 12:47 PMZach Klippenstein (he/him) [MOD]
10/01/2025, 3:37 PMZach Klippenstein (he/him) [MOD]
10/01/2025, 3:37 PM