Skip to content

Commit

Permalink
Merge pull request #290 from open-source-labs/dev
Browse files Browse the repository at this point in the history
fix: linking anchors were not being cleared in some situations where input/output logic was stopping an edge from being created
  • Loading branch information
briangregoryholmes authored Apr 26, 2023
2 parents e5b8ba6 + 4fe503e commit b28aa6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelvet",
"version": "7.0.26",
"version": "7.0.28",
"description": "A lightweight Svelte component library for building dynamic, node-based user interfaces",
"keywords": [
"svelte",
Expand Down
10 changes: 7 additions & 3 deletions src/lib/components/Anchor/Anchor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,18 @@
// If the anchor is already connected and multiple connections are not allowed
// We don't want to create a new edge
if ($connectedAnchors?.size && !multiple) return;
if ($connectedAnchors?.size && !multiple) {
clearAllLinking();
return;
}
if (
$linkingAny === anchor ||
$linkingOutput?.anchor === anchor ||
$linkingInput?.anchor === anchor
)
) {
clearAllLinking();
return;
}
updatePosition();
// Create edge
Expand Down

0 comments on commit b28aa6a

Please sign in to comment.