Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: prevent area picker from immediately releasing click-drag on some platforms

shashank-sn9be96b9805a4
diff --git a/apps/desktop/src/components/Cropper.tsx b/apps/desktop/src/components/Cropper.tsx
index 55e94eb84..0dd42288f 100644
--- a/apps/desktop/src/components/Cropper.tsx
+++ b/apps/desktop/src/components/Cropper.tsx
@@ -716,8 +716,12 @@ export function Cropper(
// 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.
+ // Defer the capture check by one microtask so setPointerCapture has time
+ // to finalize before we decide the session is orphaned.
blur: () => {
- if (!target.hasPointerCapture?.(pointerId)) finish();
+ queueMicrotask(() => {
+ if (!target.hasPointerCapture?.(pointerId)) finish();
+ });
},
});
createEventListenerMap(target, {