fix(core): check if prevClosestHandle exists in onPointerUp

This commit is contained in:
braks
2023-02-06 00:56:23 +01:00
parent 357b3f096f
commit 1d3126e4fe
@@ -154,8 +154,10 @@ export function handlePointerDown({
} }
function onPointerUp(event: MouseEvent | TouchEvent) { function onPointerUp(event: MouseEvent | TouchEvent) {
if (connection && isValid) { if (prevClosestHandle) {
onConnect?.(connection); if (connection && isValid) {
onConnect?.(connection);
}
} }
// it's important to get a fresh reference from the store here // it's important to get a fresh reference from the store here