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

View File

@@ -154,8 +154,10 @@ export function handlePointerDown({
}
function onPointerUp(event: MouseEvent | TouchEvent) {
if (connection && isValid) {
onConnect?.(connection);
if (prevClosestHandle) {
if (connection && isValid) {
onConnect?.(connection);
}
}
// it's important to get a fresh reference from the store here