You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the relevant code in Quill v2 changed considerably: in particular the signature of the onPaste() callback used to accept a single event argument, but now it takes a delta and an object with text and html selection.
Hey sorry for late reply, you should actually change some parts of the source code.
If you just want a plain paste use the below code:
classPlainTextClipboardextendsQuill.import('modules/clipboard'){constructor(quill,options){super(quill,options)// Parse the toolbar configuration of the incoming module (that is, the two-dimensional array described earlier) and render the toolbar}onCapturePaste(e){e.preventDefault()console.log("pasting")constrange=this.quill.getSelection(true)consttext=e.clipboardData.getData('text/plain')this.quill.deleteText(range.index,range.length,Quill.sources.USER)this.quill.insertText(range.index,text,Quill.sources.USER)this.quill.setSelection(range.index+text.length,Quill.sources.SILENT)}}
make sure to add the module to quill
if you want to modify the source code, clone the repo and make changes in the onpaste function.
Here is the codepen.
I can't paste because of this issue. I hope you'll be able to resolve this. Thanks
The text was updated successfully, but these errors were encountered: