singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 840 forks source link

Image pastes as plain text with unusual string on Android when copied from Samsung Gallery #2323

Closed EchoEllet closed 1 week ago

EchoEllet commented 1 month ago

Is there an existing issue for this?

Flutter Quill version

10.7.5

Steps to reproduce

  1. Run the example Android, with the latest version (e.g. 10.8.4) or older versions (e.g. 10.7.5).
  2. Copy an image from the gallery app, specifically the Samsung gallery app (not Google Photos) on a real device.
  3. Paste it using the paste button in the toolbar or the context menu.

Expected results

Actual results

Additional Context

At first, I assumed this was a regression from #2230 though I'm able to reproduce the issue on older versions.

It looks like Clipboard.getData(Clipboard.kTextPlain) returns a strange String and this issue doesn't happen when copying an image from the browser or other apps.

I tried super_clipboard (since quill_native_bridge doesn't have getClipboardText()) and it seems it returns null which is correct and the expected behavior.

This is a disruptive bug, I'm uncertain if this bug is from Clipboard.getData(Clipboard.kTextPlain) or from that Samsung gallery app.

EchoEllet commented 1 month ago

Another bug while reproducing:

https://github.com/user-attachments/assets/a9cbe8cd-ff1a-4823-bc7b-4c9b540f07f7

EchoEllet commented 1 month ago

This bug seems to be similar on iOS. We probably have a regression with the context menu.

https://github.com/user-attachments/assets/e5b77cb0-3912-4f9f-8670-6d8b5c0531fe