From 68798522af90fbfd32eb880824bf40830c603d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Mon, 8 Jun 2020 11:50:41 +0200 Subject: [PATCH] :bug: Check data type when reading d&d data --- frontend/src/uxbox/util/dom/dnd.cljs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/uxbox/util/dom/dnd.cljs b/frontend/src/uxbox/util/dom/dnd.cljs index 55d7bd64db..b78ac90191 100644 --- a/frontend/src/uxbox/util/dom/dnd.cljs +++ b/frontend/src/uxbox/util/dom/dnd.cljs @@ -8,6 +8,7 @@ (ns uxbox.util.dom.dnd "Drag & Drop interop helpers." (:require + [cuerdas.core :as str] [uxbox.util.data :refer (read-string)] [uxbox.util.transit :as t])) @@ -77,7 +78,10 @@ (get-data e "uxbox/data")) ([e data-type] (let [dt (.-dataTransfer e)] - (t/decode (.getData dt data-type))))) + (if (or (str/starts-with? data-type "uxbox") + (= data-type "application/json")) + (t/decode (.getData dt data-type)) + (.getData dt data-type))))) (defn get-files [e]