Browse Source

through return when items.length > 1

yusuketk 7 years ago
parent
commit
0a1b16f79c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/client/js/components/PageEditor/Editor.jsx

+ 2 - 2
src/client/js/components/PageEditor/Editor.jsx

@@ -109,11 +109,11 @@ export default class Editor extends AbstractEditor {
     const items = event.clipboardData.items || event.clipboardData.files || [];
     const items = event.clipboardData.items || event.clipboardData.files || [];
 
 
     // abort if length is not 1
     // abort if length is not 1
-    if (items.length != 1) {
+    if (items.length < 1) {
       return;
       return;
     }
     }
 
 
-    const file = items[0].getAsFile();
+    const file = items[items.length-1].getAsFile();
     // check type and size
     // check type and size
     if (pasteHelper.fileAccepted(file, dropzone.props.accept) &&
     if (pasteHelper.fileAccepted(file, dropzone.props.accept) &&
         pasteHelper.fileMatchSize(file, dropzone.props.maxSize, dropzone.props.minSize)) {
         pasteHelper.fileMatchSize(file, dropzone.props.maxSize, dropzone.props.minSize)) {