-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Have you checked for an existing issue?
- I have searched the existing issues
Flutter Quill Version
11.5.0
Steps to Reproduce
- Open a QuillEditor with multiple paragraphs or bullet points on web or desktop platform
- Click and drag downward to select text (e.g., start at "Look" and drag to select "Look at pictures")
- Observe the selection during the drag operation
Expected results
Selection should smoothly follow the mouse position, selecting text from the click start point to the current mouse position.
Actual results
- Selection erratically extends upward to content above the drag start point during the drag
- The visual selection jumps around unpredictably during drag
- Selection snaps to the correct position only when mouse button is released
Additional Context
After investigating the source code, the issue appears to be in RenderEditor.getPositionForOffset() or RenderEditor.extendSelection() which incorrectly calculates text positions during drag operations, particularly near line boundaries.
Key observations:
- The bug occurs at the render/paint level before the controller is notified
- Controller-based workarounds (intercepting selection changes) don't work because the visual glitch happens before any listener is called
- The final selection on mouse release IS correct - only the visual feedback during drag is wrong
This may be related to:
- Text highlighting/selection issue with Flutter 3.27.2 on Web #2450 - Text highlighting/selection issue with Flutter 3.27.2 on Web
- Flutter web Text Drag selection is not working perfectly #2603 - Flutter web Text Drag selection is not working perfectly
Workaround Attempts (Failed)
- SelectionSmootherWrapper with controller listener - Controller not notified during drag
- RawGestureDetector to intercept gestures - QuillEditor's internal gesture detector wins arena
- Listener with position smoothing - Same issue, render happens before notification
None of these work because the visual issue occurs at the RenderEditor paint level.
Suggested Fix Location
The issue likely needs to be fixed in one of these locations:
lib/src/editor/editor.dart→RenderEditor.extendSelection()lib/src/editor/editor.dart→RenderEditor.getPositionForOffset()lib/src/editor/widgets/delegate.dart→onDragSelectionUpdate()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working