vue-quill-editor icon indicating copy to clipboard operation
vue-quill-editor copied to clipboard

Triggering clipboard with initial model value

Open v1talii-dev opened this issue 4 years ago • 1 comments

It seems like when a new instance of quill-editor is created it triggers an event on the clipboard. This behavior doesn't happen in the original version of quilljs. I looked into the code and seems like you're using pasteHTML to insert the initial value, which makes it trigger the clipboard.

Context: On my application I'm listening for content that is pasted into the editor so I can clean up the content being pasted, the problem is that every time a new instance of quill-editor is created, it triggers a clipboard event.

Here's a code example:

/// this should be triggered ONLY when a new text is pasted from the clipboard.
quill.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => {
  return new Delta().insert(node.textContent);
});

v1talii-dev avatar Aug 05 '21 13:08 v1talii-dev

@surmon-china

v1talii-dev avatar Aug 05 '21 13:08 v1talii-dev