From 0593d089c58ccf518178e6a526d8ce4c5d134457 Mon Sep 17 00:00:00 2001 From: Bryan Fox Date: Mon, 15 Oct 2018 17:19:58 -0400 Subject: [PATCH] Prevent app from accepting dropped files/snippets --- src/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/index.js b/src/index.js index 9251572a6..fa5306272 100644 --- a/src/index.js +++ b/src/index.js @@ -14,6 +14,16 @@ import Routes from './routes'; import ClipPaths from './components/ClipPaths'; import { actionCreators as protocolsActions } from './ducks/modules/protocols'; +// This prevents user from being able to drop a file anywhere on the app +document.addEventListener('drop', (e) => { + e.preventDefault(); + e.stopPropagation(); +}); +document.addEventListener('dragover', (e) => { + e.preventDefault(); + e.stopPropagation(); +}); + initReactFastclick(); const startApp = () => {