diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 32c214814..a9aeca2be 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -435,11 +435,12 @@ (mf/use-callback (fn [event] (let [target (dom/get-target event) - closest (.closest target ".public-DraftStyleDefault-block")] - (when-not closest - ;; Capture mouse pointer to detect the movements even if cursor - ;; leaves the viewport or the browser itself - ;; https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture + closest (.closest target "foreignObject")] + ;; Capture mouse pointer to detect the movements even if cursor + ;; leaves the viewport or the browser itself + ;; https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture + (if closest + (.setPointerCapture closest (.-pointerId event)) (.setPointerCapture target (.-pointerId event)))))) on-pointer-up