Status Update
Comments
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #2
First of all thanks for this detailed issue.
This issue had been investigated thoroughly when it was first reported internally. The surprising detail in this report is that the issue is not reproducible before 1.7
. I will look into this.
The main problem with POBox is the fact that it is deprecated. Since 2021 Sony has been shipping new Xperia devices with Gboard pre-installed. Although we are aware that there is still a considerable amount of users still using POBox, the described behavior is caused by POBox's noncompliant behavior with InputConnection
and InputMethodManager
documentation. However, this is understandable since TextView
implementation was also not respecting the behavior that is expected from Editors.
Ultimately we have decided to enforce the documented behavior with specifically regards to when editors should call InputMethodManager.updateSelection
. Also, although unconfirmed, there were traces of possible custom code being included in Sony OEM images that changed how InputMethodManager was notified from TextView. If POBox also depended on something like this, it would be impossible for Compose code to replicate the same unknown behavior.
ma...@google.com <ma...@google.com> #3
Or is that option not available?
Even if the root cause is POBox, from the perspective of the app's customers, it looks like an app bug, so this issue is a blocker against updating Jetpack Compose.
si...@google.com <si...@google.com> #4
Just to be sure, it is dangerous to replace Compose TextField with Android View EditText as a workaround for this issue.
Compose 1.7 has a bug that causes ANR when the focus is on EditText.
Another View-related bug in Compose 1.7 is that an Android View is focused by calling FocusManager.clearFocus().
Perhaps there is a lack of testing of Compose 1.7 in combination with Android View. There is also a possibility that there are other fatal bugs related to View.
In other words, the only options for apps targeting the Japanese market that require POBox support are to continue using Compose 1.6 or to use EditText in combination with various workarounds.
ex...@gmail.com <ex...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Halil Ozercan <
Link:
Fix POBox keyboard issue
Expand for full commit details
Fix POBox keyboard issue
Fix: 373743376
Fix: 329209241
Test: NullableInputConnectionWrapperTest
Change-Id: I94e0e598274fb88b255f977f9fbd50dfbbb1ecb1
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapperTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapper.android.kt
Hash: 57f58c4b80d5d8470b2aca325dfdcd55f235231e
Date: Thu Oct 24 01:25:20 2024
ma...@google.com <ma...@google.com> #6
Many thanks again for this report. Especially for giving us a huge clue in terms of what could be going wrong. The fix is now merged and I will ask for a cherry-pick into a stable release.
si...@google.com <si...@google.com> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
ex...@gmail.com <ex...@gmail.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
ex...@gmail.com <ex...@gmail.com> #9
Thanks for the fix. Sorry to follow up on this. is it possible for you to share specific release version/date for the stable version? We are waiting on this to decide on our direction.
si...@google.com <si...@google.com>
qq...@google.com <qq...@google.com> #10
The way how Android and Chrome can select the first word is by word-based selection when dragging the left handle into the first word's visual range.
si...@google.com <si...@google.com> #11
I believe this might require something else other than char based word based selection. the dup ticket might be one way of doing it however it may not solve the issue based on the video in
I wonder if when selection handle approaches or touches the edge, it should actually horizontally transform, ( going from -> to <-, or from -> to |)
Therefore this might be a UX improvement and need UX input.
Qinginq, can you please describe how the dup ticket would help in this case?
si...@google.com <si...@google.com> #12
(actually looking at the video in
qq...@google.com <qq...@google.com> #13
But when the first word is partially selected, then the selection became char-based anyway.
I think it may have something to do with dragging handle and handle's position is completely inside the screen (vs. partially inside).
The dragging gesture detector is attached to the handle (popup window), so it can't go to the left?
I could be wrong. But anyway the handle's position needs to be fixed too.
qq...@google.com <qq...@google.com> #15
Since this is a public bug, I will not mark it as duplicate.
si...@google.com <si...@google.com> #16
Just to make sure: the exact same behavior happens on android Text as well (handle disappearing completely). Is it correct?
qq...@google.com <qq...@google.com> #17
The attachment shows the selection in a single TextView without padding. The left selection handle disappears completely when the first word is selected.
si...@google.com <si...@google.com> #18
Thank you very much Qingqing.
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit c3953106eb37da7dbeff1ae7ca8d9f92223061df
Author: Qingqing Deng <qqd@google.com>
Date: Mon Apr 26 12:46:12 2021
[Text Selection] Clip Selection Handle
Bug:185942455
Bug:183408447
Test: ./gradlew test
RelNote: Clip Selection Handle
Change-Id: Iff80d27fbac0e4de5e3e99fac4352cd6ef2cd201
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/selection/AndroidSelectionHandles.android.kt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta06.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta07.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.android.kt
qq...@google.com <qq...@google.com>
ex...@gmail.com <ex...@gmail.com> #20
I retried the original example (as described in
As a slight variation of the problem, modify the example to replace line 1 ("This text is selectable") with one long word (I actually tried a number, "1234567890123456789") and 1) select it (that works) 2) drag the left handle right and release it somewhere within the number 3) try to drag left again and select the whole number (very hard to do). (If you don't release before dragging left it works.)
This issue shows up in my real app as well (I don't have zero padding, but I guess not "enough").
ex...@gmail.com <ex...@gmail.com> #21
I still see this issue on beta09. I suppose I will have to file a new issue since this one is 'Fixed (Verified)'?
ex...@gmail.com <ex...@gmail.com> #22
The behavior I described in
cl...@google.com <cl...@google.com>
ha...@google.com <ha...@google.com>
ha...@google.com <ha...@google.com> #23
I've checked the framework TextView
behavior and noticed a different handle drag behavior from Compose selection:
So in TextView
when the left handle is at the word bound, dragging it left will extend the handle to the previous word boundary. Check the screen record attached. And this feature is helping user to selection the text at left boundary.
ha...@google.com <ha...@google.com> #24
Also checked that Chrome has similar behavior. Now working on implement a similar behavior in Compose SelectionContainer
.
ha...@google.com <ha...@google.com> #25
The remaining work is more related to
Description
Jetpack Compose Beta02, AS Canary 10
Using
SelectionContainer
without start padding, you can't select a word midsentence and drag the text selection handle left to include the first word -- unless you have sufficient start padding.To reproduce:
PartiallySelectableText()
fromIf you include
Column (modifier = Modifier.padding(start = 25.dp))
, it works as expected.