From 483ffb58caf1bd7d5eb2a59c27c78c0d8d437e63 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 1 Aug 2021 21:42:11 +0200 Subject: [PATCH] disabled default drag and drop behaviour --- src/index.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 7bd0e1f..b856aeb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -9,6 +9,16 @@ const client = new ApolloClient({ cache: new InMemoryCache() }) +// Disable drag and drop behaviour on document +function disable(event: DragEvent) { + event.preventDefault() + event.stopPropagation() +} +document.addEventListener("dragenter",disable) +document.addEventListener("dragleave",disable) +document.addEventListener("dragover",disable) +document.addEventListener("drop",disable) + ReactDOM.render(