Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(cropper): keep area drag alive on blur while pointer capture held

Richie McIlroy7f8a7769ce37
diff --git a/apps/desktop/src/components/Cropper.tsx b/apps/desktop/src/components/Cropper.tsx
index a363ac08f..55e94eb84 100644
--- a/apps/desktop/src/components/Cropper.tsx
+++ b/apps/desktop/src/components/Cropper.tsx
@@ -713,7 +713,12 @@ export function Cropper(
},
pointerup: finishForPointer,
pointercancel: finishForPointer,
- blur: finish,
+ // While pointer capture is held the drag is still ours even if the window
+ // loses focus (e.g. another overlay or the camera window grabs it on
+ // Windows). Real pointer loss arrives via pointercancel/lostpointercapture.
+ blur: () => {
+ if (!target.hasPointerCapture?.(pointerId)) finish();
+ },
});
createEventListenerMap(target, {
lostpointercapture: finishForPointer,