chenjuneking / quill-image-drop-and-paste

A quill editor module for drop and paste image, with a callback hook before insert image into the editor
ISC License
105 stars 44 forks source link

plain text file drop is not working #22

Closed nmitra6 closed 3 years ago

nmitra6 commented 3 years ago

When a plain text file is dropped on editor, following errors are raised at browser console and drop event fails (Chrome Version 91.0.4472.164 (Official Build) (64-bit))

QuillImageDropAndPaste.js:162 Uncaught TypeError: file.getAsString is not a function at QuillImageDropAndPaste.js:162 at FileList.forEach () at ImageDropAndPaste.readFiles (QuillImageDropAndPaste.js:152) at ImageDropAndPaste.handleDrop (QuillImageDropAndPaste.js:121) (anonymous) @ QuillImageDropAndPaste.js:162 readFiles @ QuillImageDropAndPaste.js:152 handleDrop @ QuillImageDropAndPaste.js:121

chenjuneking commented 3 years ago

hi, @nmitra6 . I tried to fixed this issue, but none of the errors throw when I dropped a plain text file, could you apply more details?

  1. what's your quill-image-drop-and-paste version?
  2. what's the content of your plain text and its suffix name?
nmitra6 commented 3 years ago

quill-image-drop-and-paste - version 1.2.1 simple text file with 1 or 2 sentences. suffix - .txt

chenjuneking commented 3 years ago

fixed on v1.2.5