File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -984,19 +984,21 @@ class RenderEditor extends RenderEditableContainerBox
984984
985985 if (position.offset < _extendSelectionOrigin! .baseOffset) {
986986 _handleSelectionChange (
987- TextSelection (
987+ DragTextSelection (
988988 baseOffset: position.offset,
989989 extentOffset: _extendSelectionOrigin! .extentOffset,
990990 affinity: selection.affinity,
991+ first: true ,
991992 ),
992993 cause,
993994 );
994995 } else if (position.offset > _extendSelectionOrigin! .extentOffset) {
995996 _handleSelectionChange (
996- TextSelection (
997+ DragTextSelection (
997998 baseOffset: _extendSelectionOrigin! .baseOffset,
998999 extentOffset: position.offset,
9991000 affinity: selection.affinity,
1001+ first: false ,
10001002 ),
10011003 cause,
10021004 );
@@ -1055,10 +1057,11 @@ class RenderEditor extends RenderEditableContainerBox
10551057 extentOffset = math.max (fromPosition.offset, toPosition.offset);
10561058 }
10571059
1058- final newSelection = TextSelection (
1060+ final newSelection = DragTextSelection (
10591061 baseOffset: baseOffset,
10601062 extentOffset: extentOffset,
10611063 affinity: fromPosition.affinity,
1064+ first: toPosition == null || fromPosition.offset <= toPosition.offset,
10621065 );
10631066
10641067 // Call [onSelectionChanged] only when the selection actually changed.
Original file line number Diff line number Diff line change @@ -498,22 +498,24 @@ class _TextSelectionHandleOverlayState
498498
499499 final isNormalized =
500500 widget.selection.extentOffset >= widget.selection.baseOffset;
501- TextSelection newSelection;
501+ DragTextSelection newSelection;
502502 switch (widget.position) {
503503 case _TextSelectionHandlePosition .start:
504- newSelection = TextSelection (
504+ newSelection = DragTextSelection (
505505 baseOffset:
506506 isNormalized ? position.offset : widget.selection.baseOffset,
507507 extentOffset:
508508 isNormalized ? widget.selection.extentOffset : position.offset,
509+ first: true ,
509510 );
510511 break ;
511512 case _TextSelectionHandlePosition .end:
512- newSelection = TextSelection (
513+ newSelection = DragTextSelection (
513514 baseOffset:
514515 isNormalized ? widget.selection.baseOffset : position.offset,
515516 extentOffset:
516517 isNormalized ? position.offset : widget.selection.extentOffset,
518+ first: false ,
517519 );
518520 break ;
519521 }
You can’t perform that action at this time.
0 commit comments