-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix: Deleting text in EditableText with CJK keyboard while in CupertinoPageRoute throws exception
#153822
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
Fix: Deleting text in EditableText with CJK keyboard while in CupertinoPageRoute throws exception
#153822
Conversation
EditableText while in CupertinoPageRoute throws exception
EditableText while in CupertinoPageRoute throws exceptionEditableText while in CupertinoPageRoute throws exception
EditableText while in CupertinoPageRoute throws exceptionEditableText with CJK keyboard while in CupertinoPageRoute throws exception
justinmc
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 👍
Is this for the software keyboard? What a roundabout bug. Thanks for fixing.
| await tester.pumpAndSettle(); | ||
| expect(tester.takeException(), isNull); | ||
| expect(state.selectionOverlay, isNotNull); | ||
| expect(state.selectionOverlay!.toolbarIsVisible, false); |
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.
Nit: Maybe also expect that the text has changed so that the selected word is gone? If you think it's valuable.
|
Yeah this was for the software keyboard. For some reason this bug does not affect |
|
auto label is removed for flutter/flutter/153822, due to - The status or check suite Linux web_long_running_tests_5_5 has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
auto label is removed for flutter/flutter/153822, due to - The status or check suite Linux web_long_running_tests_5_5 has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…rtinoPageRoute` throws exception (flutter#153822) Fixes flutter#153003 Pressing backspace on CJK keyboards to delete text may trigger a key event which in turns triggers the `DeleteTextIntent`. This is different than English keyboards where the updated `TextEditingValue` from the `TextInputPlugin` will come through `updateEditingValue` which allows us to hit the codepath that hides the text selection toolbar. https://github.com/flutter/flutter/blob/23883b13d4919bed4f572e78cb60c016bb3b872f/packages/flutter/lib/src/widgets/editable_text.dart#L3245-L3250 Because CJK keyboards may not hit this codepath, when the text is long and editable text tries to bring the new selection into view by scrolling, this triggers the hide context menu scroll listener in a weird state https://github.com/flutter/flutter/blob/23883b13d4919bed4f572e78cb60c016bb3b872f/packages/flutter/lib/src/widgets/editable_text.dart#L3865-L3869 causing an exception to be thrown. This PR tries to work around the issue above by hiding the toolbar when a `DeleteTextIntent` is received.
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
…in `CupertinoPageRoute` throws exception (flutter/flutter#153822)
Fixes #153003
Pressing backspace on CJK keyboards to delete text may trigger a key event which in turns triggers the
DeleteTextIntent. This is different than English keyboards where the updatedTextEditingValuefrom theTextInputPluginwill come throughupdateEditingValuewhich allows us to hit the codepath that hides the text selection toolbar.flutter/packages/flutter/lib/src/widgets/editable_text.dart
Lines 3245 to 3250 in 23883b1
flutter/packages/flutter/lib/src/widgets/editable_text.dart
Lines 3865 to 3869 in 23883b1
This PR tries to work around the issue above by hiding the toolbar when a
DeleteTextIntentis received.Pre-launch Checklist
///).