File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1101,6 +1101,9 @@ class _AndroidDocumentTouchInteractorState extends State<AndroidDocumentTouchInt
1101
1101
final fingerDocumentPosition = _docLayout.getDocumentPositionNearestToOffset (
1102
1102
_startDragPositionOffset! + fingerDragDelta - Offset (0 , scrollDelta),
1103
1103
)! ;
1104
+ if (fingerDocumentPosition != widget.selection.value! .extent) {
1105
+ HapticFeedback .lightImpact ();
1106
+ }
1104
1107
_selectPosition (fingerDocumentPosition);
1105
1108
}
1106
1109
@@ -1470,6 +1473,7 @@ class SuperEditorAndroidControlsOverlayManagerState extends State<SuperEditorAnd
1470
1473
void _updateDragHandleSelection (DocumentSelection newSelection) {
1471
1474
if (newSelection != widget.selection.value) {
1472
1475
widget.setSelection (newSelection);
1476
+ HapticFeedback .lightImpact ();
1473
1477
}
1474
1478
}
1475
1479
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import 'dart:math';
3
3
4
4
import 'package:flutter/gestures.dart' ;
5
5
import 'package:flutter/material.dart' ;
6
+ import 'package:flutter/services.dart' ;
6
7
import 'package:super_editor/src/infrastructure/flutter/flutter_scheduler.dart' ;
7
8
import 'package:super_editor/src/infrastructure/multi_listenable_builder.dart' ;
8
9
import 'package:super_editor/src/infrastructure/_logging.dart' ;
@@ -341,6 +342,7 @@ class _AndroidEditingOverlayControlsState extends State<AndroidEditingOverlayCon
341
342
void _updateDragHandleSelection (TextSelection selection) {
342
343
if (selection != widget.editingController.textController.selection) {
343
344
widget.editingController.textController.selection = selection;
345
+ HapticFeedback .lightImpact ();
344
346
}
345
347
}
346
348
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/gestures.dart' ;
2
2
import 'package:flutter/material.dart' ;
3
+ import 'package:flutter/services.dart' ;
3
4
import 'package:super_editor/src/infrastructure/_logging.dart' ;
4
5
import 'package:super_editor/src/infrastructure/flutter/flutter_scheduler.dart' ;
5
6
import 'package:super_editor/src/infrastructure/multi_tap_gesture.dart' ;
@@ -316,10 +317,15 @@ class AndroidTextFieldTouchInteractorState extends State<AndroidTextFieldTouchIn
316
317
return ;
317
318
}
318
319
319
- widget.textController.selection = TextSelection .collapsed (
320
+ final newSelection = TextSelection .collapsed (
320
321
offset: _globalOffsetToTextPosition (details.globalPosition).offset,
321
322
);
322
323
324
+ if (newSelection != widget.textController.selection) {
325
+ widget.textController.selection = newSelection;
326
+ HapticFeedback .lightImpact ();
327
+ }
328
+
323
329
setState (() {
324
330
_globalDragOffset = _globalDragOffset! + details.delta;
325
331
_dragOffset = _dragOffset! + details.delta;
You can’t perform that action at this time.
0 commit comments