diff --git a/frontend/src/uxbox/main/ui/workspace/sortable.cljs b/frontend/src/uxbox/main/ui/workspace/sortable.cljs index 823433602..e217ababa 100644 --- a/frontend/src/uxbox/main/ui/workspace/sortable.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sortable.cljs @@ -22,14 +22,14 @@ [_, drop] (rdnd/useDrop #js {:accept type :hover (fn [item monitor] - (when (.-current ref) + (when (unchecked-get ref "current") (on-hover (unchecked-get item "data") monitor))) :drop (fn [item monitor] - (when (.-current ref) + (when (unchecked-get ref "current") (on-drop (unchecked-get item "data") monitor)))}) [props, drag] (rdnd/useDrag #js {:item #js {:type type :data data} - :collect (fn [monitor] + :collect (fn [^js/ReactDnd.Monitor monitor] #js {:dragging? (.isDragging monitor)})})] [(mfu/obj->map props) (drag (drop ref))])) diff --git a/frontend/tools.clj b/frontend/tools.clj index 88817f1c2..dd37087ec 100644 --- a/frontend/tools.clj +++ b/frontend/tools.clj @@ -30,6 +30,7 @@ :language-out :ecmascript5 :closure-defines closure-defines :optimizations :none + :infer-externs true :verbose true :source-map true :static-fns false diff --git a/frontend/vendor/react-dnd/externs.js b/frontend/vendor/react-dnd/externs.js index 223a8e564..87aa30e26 100644 --- a/frontend/vendor/react-dnd/externs.js +++ b/frontend/vendor/react-dnd/externs.js @@ -1,4 +1,7 @@ var ReactDnd = {}; +ReactDnd.Monitor = function() {} +ReactDnd.Monitor.prototype.isDragging = function() {} + ReactDnd.useDrag = function() {}; ReactDnd.useDrop = function() {}; ReactDnd.DndProvider = function() {};