Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOS-Simulator] TextField Text Cursor Jumps Around After Using CMD+A then Delete to clear all text preventing further text input. #4787

Closed
babramovitch opened this issue May 9, 2024 · 1 comment
Assignees
Labels
bug Something isn't working input Touch, mouse, keyboard input related ios text

Comments

@babramovitch
Copy link

babramovitch commented May 9, 2024

Describe the bug

When you are using a physical keyboard to type into a simulator TextField and use CMD-A to highlight everything and then delete it, the TextField begins having troubles with the cursor and text continues to get deleted as you type.

Affected platforms

Platform: iOS

Versions

  • Libraries:
    • Compose Multiplatform version: 1.6.2
  • Kotlin version: 1.9.23
  • OS version(s) MacOS Ventura 13.6.4
  • OS architecture (x86 or arm64): Arm64
  • Device: Simulator iOS 17.2 iPhone 15 Pro

To Reproduce

Steps to reproduce the behavior:

  1. Run this code snippet:
     fun MainViewController() =
         ComposeUIViewController {
    
         val value1 = remember { mutableStateOf("") }
         val value2 = remember { mutableStateOf("") }
    
         Column {
             Spacer(modifier = Modifier.height(200.dp))
    
             TextField(
                 modifier = Modifier.fillMaxWidth().height(100.dp).background(Color.Gray),
                 value = value1.value,
                 onValueChange = {
                     value1.value = it
                 }
             )
    
             TextField(
                 modifier = Modifier.fillMaxWidth().height(100.dp).background(Color.Gray),
                 value = value2.value,
                 onValueChange = {
                     value2.value = it
                 }
             )
         }
     }
    
  2. Type some text into field 1
  3. Type some text into field 2
  4. Use CMD-A to highlight all text and field 2 and press delete
  5. Continue typing in field 2 and your text continues to get overridden.

Expected behavior
Typing continues as normal

Additional Context

Video has me typing CTRL-A but I was thinking windows. it was CMD-A

After doing the CMD-A I'm just trying to type "hello world" in both fields.

I've tried doing a long click in the field to get the select all cursor to appear and deleting things that way and that works okay. It appears to only be with CMD-A

I don't know if this would happen on a physical device with a Bluetooth keyboard attached.

brokentextfield.mov
@babramovitch babramovitch added bug Something isn't working submitted labels May 9, 2024
@babramovitch babramovitch changed the title [IOS-Simulator] TextField Text Cursor Jumps Around After Using CtrlA + Delete to clear all text. [IOS-Simulator] TextField Text Cursor Jumps Around After Using CtrlA + Delete to clear all text preventing further text input. May 9, 2024
@babramovitch babramovitch changed the title [IOS-Simulator] TextField Text Cursor Jumps Around After Using CtrlA + Delete to clear all text preventing further text input. [IOS-Simulator] TextField Text Cursor Jumps Around After Using CMD+A then Delete to clear all text preventing further text input. May 9, 2024
@MatkovIvan MatkovIvan added input Touch, mouse, keyboard input related text ios labels May 13, 2024
@babramovitch
Copy link
Author

This is fixed in 1.6.10. I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input Touch, mouse, keyboard input related ios text
Projects
None yet
Development

No branches or pull requests

3 participants