From a3f58b4663b398ecee9a1d9312733d9e6d9f8e9d Mon Sep 17 00:00:00 2001 From: David Meza Date: Tue, 9 May 2017 06:56:39 -0500 Subject: PLT-6487 Drag and drop on left hand sidebar leads the picture in the browser (#6315) --- webapp/root.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'webapp/root.jsx') diff --git a/webapp/root.jsx b/webapp/root.jsx index 94645b661..6c7643f17 100644 --- a/webapp/root.jsx +++ b/webapp/root.jsx @@ -101,6 +101,17 @@ function preRenderSetup(callwhendone) { } else { I18n.safariFix(afterIntl); } + + // Prevent drag and drop files from navigating away from the app + document.addEventListener('drop', (e) => { + e.preventDefault(); + e.stopPropagation(); + }); + + document.addEventListener('dragover', (e) => { + e.preventDefault(); + e.stopPropagation(); + }); } function renderRootComponent() { -- cgit v1.2.3-1-g7c22