DanXi icon indicating copy to clipboard operation
DanXi copied to clipboard

[BUG] 自由复制不能跨段复制

Open w568w opened this issue 4 years ago • 1 comments

自由复制的功能是由 Markdown 控件支持的,可能得等待上游解决这个问题。

w568w avatar Aug 26 '21 14:08 w568w

上游问题链接:https://github.com/flutter/flutter/issues/99819 。

w568w avatar May 06 '22 03:05 w568w

There is actually a simple fix for this:

  1. Wrap everything you expect to be selectable in SelectableArea
  2. Override MarkdownBody, it uses SelectableText.rich to implement selection but it really should use Text.rich instead. Text.rich(and also Text) extends Selectable, which automatically looks for a ancestor SelectableArea and joins the group.

singularity-s0 avatar Feb 11 '23 17:02 singularity-s0

I have created a modified flutter_markdown package that does the job. Please try https://github.com/singularity-s0/flutter_markdown_selectable when you have time. Remember to wrap the entire renderer in SelectableArea.

singularity-s0 avatar Feb 11 '23 17:02 singularity-s0

Oops, a mindless click.

w568w avatar Feb 12 '23 08:02 w568w