flutter-quill
flutter-quill copied to clipboard
[Desktop] Double click to select text sometimes doesn't work.
Double click to select chinese text sometimes doesn't work .
Need change if (position.offset >= word.end) to if (position.offset > word.end).
@override
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) {
return TextSelection.fromPosition(position);
}
return TextSelection(baseOffset: word.start, extentOffset: word.end);
}