Fixed
Status Update
Comments
po...@google.com <po...@google.com>
ol...@gmail.com <ol...@gmail.com> #2
As a sidenote, I've also noticed a different behaviour for a text selection popup.
When you select some text within View's EditText "Cut/copy/paste" popup appears. The first back button click dismisses the popup, the second back button click closes the keyboard.
For Compose's TextField it's vice versa: the first back button click closes the keyboard, the second one dismisses the popup.
I feel that this difference should be taken into account within this issue, as it relates to the back button behaviour.
kl...@google.com <kl...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e5d5463b236256094e5f005f5f03ced78eaee47f
Author: Zach Klippenstein <klippenstein@google.com>
Date: Thu Jan 20 10:26:03 2022
Make CoreTextField ignore back key press when cursor handle is showing.
Fixes: b/205726883
Test: New test, ./gradlew :compose:f:f:cAT
Relnote: "Text fields no longer require an extra back press when the
cursor handle is showing."
Change-Id: Ideb4bafc9e7ada3faf16310d96ae4abf0caca734
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldSelectionOnBackTest.kt
https://android-review.googlesource.com/1956436
Branch: androidx-main
commit e5d5463b236256094e5f005f5f03ced78eaee47f
Author: Zach Klippenstein <klippenstein@google.com>
Date: Thu Jan 20 10:26:03 2022
Make CoreTextField ignore back key press when cursor handle is showing.
Fixes:
Test: New test, ./gradlew :compose:f:f:cAT
Relnote: "Text fields no longer require an extra back press when the
cursor handle is showing."
Change-Id: Ideb4bafc9e7ada3faf16310d96ae4abf0caca734
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldSelectionOnBackTest.kt
pc...@gmail.com <pc...@gmail.com> #4
Which compose version this bug fix is included?
Description
Jetpack Compose release version: 1.1.0-beta02
Android Studio Build: Android Studio Arctic Fox | 2020.3.1 Patch 3
Kotlin version: 1.5.31
Similarly to the already fixed issue https://issuetracker.google.com/issues/192433071 BasicTextField and TextField require extra back button click when the cursor handle (that tear shaped element below cursor) is present in the focused TextField. It usually appears when TextField already contains some value and focused, e.g. in case of some default value:
Steps to Reproduce:
What is expected: As with EditText from View package only one back button click is expected to close keyboard and remove cursor handle.
Also attaching the video displaying the issue.