0

You have a component with a textfield

@Composable
fun Test() {
  BasicTextField("hi", { })
}

You click on the text field. The soft keyboard appears.

You close the soft keyboard with the keyboard icon below.

enter image description here.

The keybaord is gone. But the text is still selected.

enter image description here

Press the back button, the text is unselected. Press again: you exit the app.

Is is possible to have unselected text when the keyboard is dismissed as above? And so meaning you need only one back press to either exit the app or go back to the previous screen?

Or put another way: why is focusing on editable text adding to the back stack?

(Note: if I could detect when the keyboard is dismissed in jetpack compose, I could unselect the text, but I'm found now way to detect this currently).

4

0 回答 0