Skip to content

Commit

Permalink
Merge pull request #281 from codaco/fix/drop-events
Browse files Browse the repository at this point in the history
Prevent app from accepting dropped files/snippets
  • Loading branch information
jthrilly authored Oct 16, 2018
2 parents e01b9ef + 0593d08 commit 6afd09a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 6afd09a

Please sign in to comment.