-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Text selection handles are sometimes not interactive #31852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text selection handles are sometimes not interactive #31852
Conversation
03107ef to
0bf58c0
Compare
7002a32 to
aa6c887
Compare
|
I've gotten the GestureDetectors to be the correct size and position for all of the different text selection handles that we have. However, despite the GestureDetectors being the right size and in the right place, there are parts of them that are sometimes still not interactive. I think that's because of the CompositedTransformFollower that we use to reset the coordinate space. From the docs, "Hit testing on descendants of this widget will only work if the target position is within the box that this widget's parent considers to be hitable." I can't quite get a perfect visual on exactly where the widget's boundary is and if it lines up perfectly with the non-interactive regions I'm seeing, though. Update: Hit detection works in the places we need it now as of dcf30cf. |
aa6c887 to
da9aa08
Compare
da9aa08 to
056f5e1
Compare
363f071 to
49b8d57
Compare
Can I reuse tapping somehow?
49b8d57 to
c66739c
Compare
|
The last problem that I'm fighting with is that the GestureDetector swallows tap events from the text field behind it. This manifests as double tapping to select text being broken (the first tap shows the handle, which blocks the second tap). @HansMuller I've got a working solution by using Listener instead of GestureDetector, like we talked about. I was able to reuse the dragging logic from GestureDetector, but I reimplemented tap myself (poorly) because reusing any code caused the event to be swallowed. I'll talk to you on Monday about it, and hopefully I can bypass having to write my own tap if I understand a bit more about the event arena. |
4d1e0c9 to
3a848ef
Compare
1f2364c to
e0be739
Compare
386ab39 to
80382f0
Compare
80382f0 to
43241c3
Compare
…enu and expanding selection, so just document it
19b0ae3 to
3a060b7
Compare
|
@HansMuller This is ready for review. The main things this PR does to achieve its goal of making the handles nicely interactive are:
|
HansMuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, just a few small suggestions for simplifications, etc.
HansMuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fd47bef to
b8870ac
Compare
b8870ac to
d704bec
Compare


Closes #31286 #23432
Text selection handles are being moved outside of their enclosing GestureDetector, making them not interactive. I have seen this for the left Material handle at the start of a text field and for the left Cupertino handle at any position.