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
15.26k stars 1.11k forks source link

[Web/Wasm] TextField not opening keyboard in mobile browser #4836

Closed Not-Soti closed 1 month ago

Not-Soti commented 1 month ago

Describe the bug Given a Compose Web app with a TextField, if it is accessed through a browser using a mobile phone, clicking on a text field does not open the software keyboard. The TextField is receiving the focus as the labelmoves to the top side.

Affected platforms

To Reproduce Steps to reproduce the behavior:

  1. Download a new project using the Compose Multiplatform Wizard
  2. Set the App() content to this:
    @Composable
    fun App() {
    MaterialTheme {
        var input by remember { mutableStateOf("") }
        Box(
            Modifier.fillMaxSize(),
            contentAlignment = Alignment.Center
        ){
            TextField(
                modifier = Modifier,
                value = input,
                label = { Text("Label") },
                onValueChange = { input = it }
            )
        }
    }
    }
  3. Run the "wasmJsBrowserRun" gradle task, or other related local deployment task.
  4. Enter the web through a browser using a smart phone
  5. Click on the TextField

Expected behavior The software keyboard should be displayed.

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here.

eymar commented 1 month ago

It was implemented in 1.6.10. Please give it a try.