From a47a141f41d7ef7ad445797391a06028711bf264 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Tue, 24 Oct 2023 14:16:21 -0700 Subject: [PATCH] Fix: Caret not blinking on iOS after dragging to scroll (Resolves #1549) (#1557) --- .../default_editor/document_gestures_touch_ios.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart b/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart index 8e889c69f3..256792dbde 100644 --- a/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart +++ b/super_editor/lib/src/default_editor/document_gestures_touch_ios.dart @@ -580,7 +580,9 @@ class _IosDocumentTouchInteractorState extends State // Stop waiting for a long-press to start. _globalTapDownOffset = null; _tapDownLongPressTimer?.cancel(); - _controlsController!.hideMagnifier(); + _controlsController! + ..hideMagnifier() + ..blinkCaret(); if (_wasScrollingOnTapDown) { // The scrollable was scrolling when the user touched down. We expect that the @@ -589,8 +591,6 @@ class _IosDocumentTouchInteractorState extends State return; } - _controlsController!.blinkCaret(); - final selection = widget.selection.value; if (selection != null && !selection.isCollapsed && @@ -986,7 +986,9 @@ class _IosDocumentTouchInteractorState extends State void _onPanEnd(DragEndDetails details) { _magnifierOffset.value = null; - _controlsController!.hideMagnifier(); + _controlsController! + ..hideMagnifier() + ..blinkCaret(); if (_dragMode == null) { // User was dragging the scroll area. Go ballistic. @@ -1021,7 +1023,6 @@ class _IosDocumentTouchInteractorState extends State _onHandleDragEnd(); } - _controlsController!.blinkCaret(); _handleAutoScrolling.stopAutoScrollHandleMonitoring(); scrollPosition.removeListener(_onAutoScrollChange); }