import Quill from 'quill' /** Add our own check in to stop Quill from automatically blocking paste events into inputs in the editor popovers. */ const QuillClipboard = Quill.import('modules/clipboard') as new ( quill: Quill, options: Record ) => { onPaste(e: ClipboardEvent): void } export default class AllowInputPasteClipboard extends QuillClipboard { onPaste(e: ClipboardEvent, ref?: { text?: string }): void { // If we are in an editor tooltip, let the browser paste as normal const tagName = (e?.target as HTMLElement)?.nodeName if (tagName === 'INPUT') { return } // Otherwise, let Quill do whatever it wants to do with the paste event const quillPaste = (super.onPaste as (e: ClipboardEvent, ref?: { text?: string }) => void).bind(this) quillPaste(e, ref) } }