From 1143f7eb439048a7be5b2c8126a21c02a12e8ab2 Mon Sep 17 00:00:00 2001 From: Xin Yao Date: Tue, 14 Sep 2021 20:49:11 -0700 Subject: [PATCH] Swapping handles order is prevented --- lib/src/widgets/text_selection.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/widgets/text_selection.dart b/lib/src/widgets/text_selection.dart index f11a42c4..833a21e9 100644 --- a/lib/src/widgets/text_selection.dart +++ b/lib/src/widgets/text_selection.dart @@ -407,6 +407,10 @@ class _TextSelectionHandleOverlayState break; } + if (newSelection.baseOffset >= newSelection.extentOffset) { + return; // don't allow order swapping. + } + widget.onSelectionHandleChanged(newSelection); }