Status Update
Comments
si...@google.com <si...@google.com>
ma...@google.com <ma...@google.com> #3
coming back to this issue. I see this is because we just cannot really drag handle behind the screen (because the "pointer" of the handle is where we select the text, so the handle need to be out of the screen to select the last letter).
That being said, if being super careful I'm able to select the whole first word even with no padding (sometimes takes a few attempts).
Siyamed, how do you deal with this in the platform text? Frankly, I expect no text to be at the very edge of the screen in the real apps, and since it's possible to select by just raising the selection handle higher (positionning at the line above seelcted the whole line) idk how big the problem is.
Anyway, reassigning to Siyamed to investigate the selection in the platform for clues or ask someone from the text team to do it.
si...@google.com <si...@google.com> #4
Thanks.
Can you please elaborate on the first sentence?
I see this is because we just cannot really drag handle behind the screen (because the "pointer" of the handle is where we select the text, so the handle need to be out of the screen to select the last letter).
I did not understand dragging the handle behind the screen.
ex...@gmail.com <ex...@gmail.com> #5
In the Gmail app for example (see image) the selection handle will get clipped to accommodate the selection, which is unlike what is happening here (see second image).
ma...@google.com <ma...@google.com> #6
Can you please elaborate on the first sentence?
to Siyamed: Sure. This is basically what exploringbinary showed in their screenshots. the start handle selects the text based on its top right corner (where the sharp pointer edge is), so in order to select the text near the edge of the screen we have to essentially drag the handle out of screen bounds, so it's top right corner is at 0 x axis. I recommend to explore how we handle this case in the platform.
re screenshots: interestingly enough, your screenshots have a margin for a gmail, that's why it's possible. I assume we can clip the handle as well, but it won't help to solve the
si...@google.com <si...@google.com> #7
got it thanks.
ex...@gmail.com <ex...@gmail.com> #8
I don't know how much start padding Gmail uses but I tried 15.dp in my Compose example and it still does not help.
ex...@gmail.com <ex...@gmail.com> #9
And while I'm here, looking at the Gmail vs Compose screenshot I'm reminded that I could really make use of a "Select all" feature in Compose :).
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.