From b95c5aec4d1704be994725a9787851fb7417c81f Mon Sep 17 00:00:00 2001 From: felix lee <limf8607@gmail.com> Date: Fri, 2 Aug 2024 00:14:54 +0800 Subject: [PATCH] fix: Double click to select text sometimes doesn't work. --- lib/src/editor/editor.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/editor/editor.dart b/lib/src/editor/editor.dart index 3a4ca35c..060b4cb5 100644 --- a/lib/src/editor/editor.dart +++ b/lib/src/editor/editor.dart @@ -1102,7 +1102,7 @@ class RenderEditor extends RenderEditableContainerBox TextSelection selectWordAtPosition(TextPosition position) { final word = getWordBoundary(position); // When long-pressing past the end of the text, we want a collapsed cursor. - if (position.offset >= word.end) { + if (position.offset > word.end) { return TextSelection.fromPosition(position); } return TextSelection(baseOffset: word.start, extentOffset: word.end);