title: How to clear TextField focus when closing the keyboard and prevent two back presses needed to exit app in Jetpack Compose?
body: <p>I'm using BasicTextField.</p>
  <p>When I start editing, back button becomes hide keyboard button(arrow down).</p>
  <p>First press on back button hides keyboard, but the focus is still on the text field. Both <code>onFocusChanged</code> and <code>BackPressHandler</code> handlers not getting called.</p>
  <p>Second press on back button clears focus: <code>onFocusChanged</code> is called and <code>BackPressHandler</code> is not.</p>
  <pre><code>BackHandler {
      println(&quot;BackPressHandler&quot;)
  }
  val valueState = remember { mutableStateOf(TextFieldValue(text = &quot;&quot;)) }
  BasicTextField(
      value = valueState.value,
      onValueChange = {
          valueState.value = it
      },
      modifier = Modifier
          .fillMaxWidth()
          .onFocusChanged {
              println(&quot;isFocused ${it.isFocused}&quot;)
          }
  )
  </code></pre>
  <p>Third time BackHandler works fine. Just used it for testing, I shouldn't be needed it here, it expected focus to get lost after first back button tap</p>