flutter-quill icon indicating copy to clipboard operation
flutter-quill copied to clipboard

[Desktop] Double click to select text sometimes doesn't work.

Open TheHeBoy opened this issue 2 years ago • 1 comments

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);
  }

Refer flutter issue

TheHeBoy avatar Jul 06 '23 14:07 TheHeBoy

The fix to this bug was reverted in 10.4.2 as it caused another bug.

See Issue #2121.

EchoEllet avatar Aug 23 '24 13:08 EchoEllet