From e7bbe75f5a207df35815f2de9913800524cfda20 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Tue, 8 Mar 2016 10:42:00 -0500 Subject: [PATCH] =?UTF-8?q?Prevent=20DragDrop=E2=80=99s=20early=20form=20s?= =?UTF-8?q?ubmitting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/DragDrop.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/DragDrop.js b/src/plugins/DragDrop.js index 872d3807a..b685eeea5 100644 --- a/src/plugins/DragDrop.js +++ b/src/plugins/DragDrop.js @@ -90,6 +90,10 @@ export default class DragDrop extends Plugin { e.stopPropagation() }) + this.dropzone.addEventListener('submit', (e) => { + e.preventDefault() + }) + // Toggle is-dragover state when files are dragged over or dropped Utils.addListenerMulti(this.dropzone, 'dragover dragenter', (e) => { Utils.addClass(this.container, 'is-dragover') @@ -147,7 +151,7 @@ export default class DragDrop extends Plugin { }) this.dropzone.addEventListener('submit', (e) => { - e.preventDefault() + return resolve(result) }) })