Repository navigation
Conversation
- Hiding the iOS system context menu no longer hides the selection handles. iOS dismisses the menu as soon as a handle is touched, and hideToolbar() with the default hideHandles = true removed the handle from under the finger. EditableText uses hideToolbar(false) here. - bringIntoView no longer throws in a non-scrollable editor: its scroll controller is not attached, so the caret is revealed through RenderEditor.showOnScreen instead. The exception interrupted handle drags before the selection was updated. Fixes fleather-editor#576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #595 +/- ##
==========================================
+ Coverage 88.10% 88.12% +0.01%
==========================================
Files 63 63
Lines 10984 10990 +6
==========================================
+ Hits 9678 9685 +7
+ Misses 1306 1305 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
@amantoux @Amir-P could you take a look when you have a moment? It fixes #576: selection handles on iOS disappear as soon as they are touched, because of the system context menu. It also fixes the exception that stops handle drags in a non-scrollable editor. Both have regression tests, and we checked the fix on a real iPhone. Thanks! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #576.
On iOS, the selection handles of a
FleatherEditorcould not be dragged: they disappeared as soon as you touched them. Inside a non-scrollable editor, dragging also stopped with an exception. We traced both causes on a real iPhone;TextFieldin the same app was not affected.Causes
SystemContextMenu.editorpasseseditorState.hideToolbarasonSystemHide, and its defaulthideHandles = truehides the whole selection overlay. The handle is removed from under the finger and the pan gesture is cancelled. Flutter'sSystemContextMenu.editableTextuseshideToolbar(false)here, which is whyTextFieldworks.scrollable: false, the editor'sscrollControlleris never attached. A handle drag callsbringIntoView, which readsscrollController.positionand throws before the selection is updated. Now, when the controller has no clients, the caret is revealed throughrenderEditor.showOnScreen. This is the same thing_showCaretOnScreendoes for a non-scrollable editor.I'm not sure the
GestureDetectorfrom the issue's reproduction is what triggers this. Cause 1 happens whenever the system context menu is in use, with or without aGestureDetector.Changes
system_context_menu.dart:onSystemHide: () => editorState.hideToolbar(false).editor_selection_delegate_mixin.dart:bringIntoViewno longer touches an unattached scroll controller.editor_test.dart. Both fail without these changes:Testing
flutter testinpackages/fleather: all tests pass. I ran them locally on Flutter 3.44.8.flutter analyzeis clean.ListView.🤖 Generated with Claude Code