From 0a6cb5f2fae9a9b51840b293fcdfde2013e8bc87 Mon Sep 17 00:00:00 2001 From: Katie Ransom Date: Wed, 11 Dec 2024 16:51:16 +0000 Subject: [PATCH] MDL-83989 file upload: Filemanager breaks if you drop file outside of it --- lib/form/dndupload.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/form/dndupload.js b/lib/form/dndupload.js index 8c612eb661e..29d4b91cb7d 100644 --- a/lib/form/dndupload.js +++ b/lib/form/dndupload.js @@ -176,10 +176,13 @@ M.form_dndupload.init = function(Y, options) { init_page_events: function() { this.Y.on('dragenter', this.drag_enter_page, 'body', this); this.Y.on('dragleave', this.drag_leave_page, 'body', this); + this.Y.on('dragover', function(e) { + e.preventDefault(); + }, 'body', this); this.Y.on('drop', function() { this.pageentercount = 0; this.hide_drop_target(); - }.bind(this)); + }, 'body', this); }, /**