Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.8k stars 874 forks source link

[BUG] Text is not copied on Windows if it contains a url. #1244

Closed vodemn closed 1 year ago

vodemn commented 1 year ago

Describe the bug:

HTML to reproduce the issue:

"<p><a href="https://www.google.com/">https://www.google.com/</a><br>test<br><a href="https://www.google.com/">https://www.google.com/</a></p>"

Html widget configuration:

SelectableHtml(
  data: """<p><a href="https://www.google.com/">https://www.google.com/</a><br>test<br><a href="https://www.google.com/">https://www.google.com/</a></p>""",
  onLinkTap: (url, __, ___, ____) {
    print(url);
  },
);

Expected behavior: Text is selectable and can be copied with Ctrl + C.

Actual behavior: Text is selectable and is not copied with Ctrl + C.

Screenshots:

Device details and Flutter/Dart/flutter_html versions:

Sub6Resources commented 1 year ago

The preferred method (as of 3.0.0-beta.1) now is to use a standard Html widget and wrap it in a SelectionArea widget provided by Flutter. This should provide better support for keyboard shortcuts, although you should check the documentation for SelectionArea.