Merge pull request #3823 from xyflow/refactor/default-handle
Refactor/default handle
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
### Patch changes
|
### Patch changes
|
||||||
|
|
||||||
- fix `OnNodeDrag` type
|
- fix `OnNodeDrag` type
|
||||||
|
- refactor(handles): do not use fallback handle if an id is being used #3409
|
||||||
|
|
||||||
## 12.0.0-next.7
|
## 12.0.0-next.7
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
## Patch changes
|
## Patch changes
|
||||||
|
|
||||||
- Edge label has a default background and is clickable
|
- Edge label has a default background and is clickable
|
||||||
|
- refactor(handles): do not use fallback handle if an id is being used #3409
|
||||||
|
|
||||||
## 0.0.34
|
## 0.0.34
|
||||||
|
|
||||||
|
|||||||
@@ -114,11 +114,6 @@ function getHandle(bounds: HandleElement[], handleId?: string | null): HandleEle
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bounds.length === 1 || !handleId) {
|
// if no handleId is given, we use the first handle, otherwise we check for the id
|
||||||
return bounds[0];
|
return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null;
|
||||||
} else if (handleId) {
|
|
||||||
return bounds.find((d) => d.id === handleId) || null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user