slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.2k stars 3.36k forks source link

Cannot paste text in Chrome. Firefox works fine. #3512

Open johnmanko opened 2 years ago

johnmanko commented 2 years ago

I'm trying to paste any random text into the quill@1.3.7 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

nathancarter commented 1 year ago

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.