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

[Web] How to override behaviour for paste with ctrl+v

Open mattia-venturini opened this issue 2 years ago • 10 comments

Is there an existing issue for this?

The question

I am trying to integrate QuillEditor with rich_clipboard. My objective is to convert the delta into html and to save it into the clipboard.

In order to do so, I have a button that copies in the clipboard the whole delta document, but I also need to handle the paste. On mobile platforms I can set the parameter contextMenuBuilder with a menu that calls a function written by me, but how can I achieve the same thing on web platform?

I tried to pass a custom Action to QuillEditorConfigurations.customActions, but it is never called by the editor when I press ctrl+V (command+V on Mac). Any idea?

mattia-venturini avatar Dec 04 '23 17:12 mattia-venturini

Hello there, on behalf the Flutter Quill Team I would like to thank you for opening your first issue. Your inputs and insights are valuable in shaping a stable and reliable version for all our users. Thank you for being part of the open-source community!

singerdmx avatar Dec 04 '23 17:12 singerdmx

rich_clipboard.

Hi, thank you for the report, first of all

Is there a reason to use rich_clipboard instead of pasteboard? because we already using it

EchoEllet avatar Dec 05 '23 04:12 EchoEllet

Is there a reason to use rich_clipboard instead of pasteboard? because we already using it

I see that pasteboard is used for handling images in copy-paste, but it's not what I am looking for. I am trying to copy the delta as html in order to paste it into other editors (i.e. other external editors or other QuillEditors in the app).

mattia-venturini avatar Dec 05 '23 15:12 mattia-venturini

Is there a reason to use rich_clipboard instead of pasteboard? because we already using it

I see that pasteboard is used for handling images in copy-paste, but it's not what I am looking for. I am trying to copy the delta as html in order to paste it into other editors (i.e. other external editors or other QuillEditors in the app).

Hi again, so you want to paste some content to the editor from the cliboard?? is this what you mean??

EchoEllet avatar Dec 06 '23 17:12 EchoEllet

What I want to achieve is to copy-paste a delta document, keeping its formatting.

Here are the use cases I would like to support:

  1. copy from a quill editor into other quill editors in the same app
  2. copy from a quill editor into other quill editors in another app (also developed by my team)
  3. copy from a quill editor into other apps, pasting it as HTML (e.g. Google Docs)
  4. copy from another app as HTML (e.g. Google Docs) into a quill editor

Note: I am using just a subset of the features of quill, such as bold, italic, underline and link.

mattia-venturini avatar Jan 29 '24 10:01 mattia-venturini

What I want to achieve is to copy-paste a delta document, keeping its formatting.

Here are the use cases I would like to support:

  1. copy from a quill editor into other quill editors in the same app
  2. copy from a quill editor into other quill editors in another app (also developed by my team)
  3. copy from a quill editor into other apps, pasting it as HTML (e.g. Google Docs)
  4. copy from another app as HTML (e.g. Google Docs) into a quill editor

Note: I am using just a subset of the features of quill, such as bold, italic, underline and link.

I will try to add a callback this week for pasting the text

EchoEllet avatar Jan 29 '24 19:01 EchoEllet

Ok, what do you have in mind?

In the meantime, as now flutter_quill depends on super_clipboard, I found a good starting point to listen to the copy/paste events, described here: https://pub.dev/packages/super_clipboard#accessing-clipboard-on-web.

mattia-venturini avatar Jan 30 '24 13:01 mattia-venturini

Can someone please guide me to how I can implement the image copy-paste feature in the flutter_quill. Thank you.

Rahul-Rasve avatar Apr 03 '24 19:04 Rahul-Rasve

Can someone please guide me to how I can implement the image copy-paste feature in the flutter_quill. Thank you.

Did you manage to implement it?

jalvespinto avatar May 05 '24 19:05 jalvespinto

No news on this? Alot of the issues on this package have something to do with this feature

DavidOrakpo avatar May 29 '24 10:05 DavidOrakpo