quill icon indicating copy to clipboard operation
quill copied to clipboard

Cannot paste text in Chrome. Firefox works fine.

Open johnmanko opened this issue 3 years ago • 1 comments

I'm trying to paste any random text into the [email protected] editor, but all of my paste events are pretty much ignored in Chrome. Firefox works fine.

Steps for Reproduction

Step 1. Code.

<div ref="editorElement" class="ql-editor" contenteditable="true"></div>
import Quill from 'quill';

@customElement('quill-editor')
export class QuillEditorComponent {

  @bindable({ defaultBindingMode: bindingMode.twoWay })  value: string;
  editorElement: any;
  editor: Quill;

  attached() { 

    var toolbarOptions = [/* removed for brevity */];

    this.editor = new Quill(this.editorElement, {
    debug: true,
      modules: { 
        toolbar: toolbarOptions,
        clipboard: {
            matchVisual: false
        }
      },
      placeholder: 'I have something to say...',
      theme: 'snow'
    });

    this.editor.root.innerHTML = this.value;
  }
}

Step 2. Copy any text, such as "To get started, check out https://quilljs.com/ for documentation, guides, and live demos!"

Step 3. Paste into quill in Chrome.

Expected behavior:

Works in Firefox: text is copied to the editor from the clipboard.

image

Actual behavior:

Doesn't work in Chrome/Chromium. Upon paste, the editor loses focus and nothing is copied to the editor from the clipboard.

image

quill:clipboard convert  Delta {
    "ops": []
}

Platforms:

Chromium: Version 96.0.4664.110 (Official Build) snap (64-bit) Firefox: 95.0.2 (64-bit)

Version:

1.3.7

johnmanko avatar Jan 04 '22 03:01 johnmanko

I am experiencing a similar bug on Brave (Chromium-based) but not Firefox. This seems like the death knell for this project because every user expects paste to work and the vast majority of the internet uses a Chromium-based browser. By the fact that this issue hasn't been replied to in 1.5 years, should I conclude that Quill is dead? That would be a real shame, because it has several excellent features that I was hoping to use, all based on its unique Delta setup under the hood.

nathancarter avatar Jul 06 '23 13:07 nathancarter