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.04k stars 1.16k forks source link

iOS 17 hidden trackpad doesn't work in the TextFields (hold space bar and swipe to move cursor) #4593

Closed OSemenovBoyarka closed 4 months ago

OSemenovBoyarka commented 6 months ago

Describe the bug The iOS 17 introduced hidden trackpad feature, when you can hold the spacebar and then move the cursor with the swipe on the keyboard. This doesn't move the cursor in any TextField in Jetpack Compose Multiplatform. Surprisingly - the same feature works fine on Android with the same code.

Affected platforms

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. Add a simple text field to the multiplatform app:
    @Composable
    fun App() {
    MaterialTheme {
        var text by remember { mutableStateOf("") }
        TextField(
            modifier = Modifier.fillMaxWidth(),
            value = text,
            onValueChange = { text = it }
        )
    }
    }
  2. Run the app on either iOS 17 device or iOS 17 simulator
  3. Enter something in the text field
  4. Hold the space bar on the soft keyboard and move finger while holding it

Expected behavior Cursor should move in the direction finger moves. Actually - cursor stays in place.

Screenshots iOS simulator, how it actually works: https://github.com/JetBrains/compose-multiplatform/assets/6439273/de8baba4-0785-4bb8-905e-6cbb34f58957

The same app running on Android Emulator (API 34): https://github.com/JetBrains/compose-multiplatform/assets/6439273/57c61cc2-2aa7-44c3-a4c1-3778b0a4c693

Additional context This is the new feature in iOS 17 - https://www.cnet.com/tech/mobile/this-secret-ios-trackpad-makes-typing-on-your-iphone-so-much-easier/

m-sasha commented 6 months ago

@mazunin-v-jb Are we working on this?

mazunin-v-jb commented 6 months ago

Yes, we're planning to support that but not in the nearest future.

okushnikov commented 1 month ago

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