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 9df03c394a..d2c3a460e9 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 @@ -626,7 +626,9 @@ class _IosDocumentTouchInteractorState extends State } if (docPosition != null) { - final didTapOnExistingSelection = selection != null && selection.isCollapsed && selection.extent == docPosition; + final didTapOnExistingSelection = selection != null && + selection.isCollapsed && + selection.extent.nodePosition.isEquivalentTo(docPosition.nodePosition); if (didTapOnExistingSelection) { // Toggle the toolbar display when the user taps on the collapsed caret, diff --git a/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart b/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart index dc902c0dbd..2d9edae532 100644 --- a/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart +++ b/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart @@ -1,6 +1,5 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; import 'package:follow_the_leader/follow_the_leader.dart'; import 'package:overlord/follow_the_leader.dart'; import 'package:super_editor/src/core/document.dart'; @@ -410,7 +409,7 @@ class IosToolbarFocalPointDocumentLayer extends DocumentLayoutLayerStatefulWidge class _IosToolbarFocalPointDocumentLayerState extends DocumentLayoutLayerState with SingleTickerProviderStateMixin { - bool _wasSelectionExpanded = false; + DocumentSelection? _selectionUsedForMostRecentLayout; @override void initState() { @@ -438,24 +437,14 @@ class _IosToolbarFocalPointDocumentLayerState extends DocumentLayoutLayerState