-
Notifications
You must be signed in to change notification settings - Fork 28.5k
TextField magnifier stuck on long press cancel #167881
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
base: master
Are you sure you want to change the base?
TextField magnifier stuck on long press cancel #167881
Conversation
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 🎉
|
||
/// Handler for [TextSelectionGestureDetector.onSingleLongTapCancel]. | ||
/// | ||
/// By default, it hides magnifier and floating cursor if necesasary. |
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.
/// By default, it hides magnifier and floating cursor if necesasary. | |
/// By default, it hides the magnifier and the floating cursor if necessary. |
@@ -3304,6 +3323,9 @@ class TextSelectionGestureDetector extends StatefulWidget { | |||
/// Called after [onSingleLongTapStart] when the pointer is lifted. | |||
final GestureLongPressEndCallback? onSingleLongTapEnd; | |||
|
|||
/// Called after [onSingleLongTapStart] when the pointer is cancelled. |
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.
/// Called after [onSingleLongTapStart] when the pointer is cancelled. | |
/// Called after [onSingleLongTapStart] when the pointer is canceled. |
@@ -2748,6 +2749,22 @@ class TextSelectionGestureDetectorBuilder { | |||
} | |||
} | |||
|
|||
void _longTapCleanup(){ |
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.
What do you think of this name?
void _longTapCleanup(){ | |
void _onSingleLongTapEndOrCancel() { |
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.
Makes sense!
FYI there's a test failure: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8716520139161227697/+/u/run_test.dart_for_framework_tests_shard_and_subshard_widgets/stdout It looks like if the text field is unmounted after a long press down, Test failure logs...
|
Fixes #167879
This PR fixes bug where magnifier and floating cursor get stuck on screen when long press is cancelled (eg. by closing the app).
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.