Hello, Is there a way to handle the long press del...
# compose
t
Hello, Is there a way to handle the long press deletion of a text in a
TextField
- it feels like previously was the default behaviour, but I think with Compose it is not :?
s
I fixed a few bugs about this. It has differences between keyboards being used, keyboard versions, android versions. If you can try out with the latest release and let us know here and preferably in buganizer i will appreciate.
t
So the problem was easily reproducible by this code
Copy code
setContent {
      val (email, setEmail) = remember { mutableStateOf("") }
      val (password, setPassword) = remember { mutableStateOf("") }

      Column {
        OutlinedTextField(
          modifier = Modifier.fillMaxWidth(),
          value = email,
          onValueChange = { setEmail(it) },
          singleLine = true
        )

        OutlinedTextField(
          modifier = Modifier.fillMaxWidth(),
          value = password,
          onValueChange = { setPassword(it) },
          singleLine = true,
          keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)
        )
      }
    }
Everything works unless you specify the
KeyboardType.Password
option (this is still problematic in 1.1.1) 1.2.0-beta01 seems to address the issue.
­čĹŹ 1