Skip to content

Commit

Permalink
Merge pull request #25 from gravity-ui/fix-can-create-new-connections…
Browse files Browse the repository at this point in the history
…-flag

fix: canCreateNewConnections config flag
  • Loading branch information
itwillwork authored Nov 29, 2024
2 parents 7a1a1cd + 40e5a4b commit cc1ffe6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/services/newConnection/ConnectionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ export class ConnectionService extends Emitter {
return;
}
if (
(this.graph.rootStore.settings.getConfigFlag("useBlocksAnchors") && target instanceof Anchor) ||
(isShiftKeyEvent(event) &&
isBlock(target) &&
this.graph.rootStore.settings.getConfigFlag("canCreateNewConnections"))
(
(this.graph.rootStore.settings.getConfigFlag("useBlocksAnchors") && target instanceof Anchor) ||
(isShiftKeyEvent(event) && isBlock(target))
) && this.graph.rootStore.settings.getConfigFlag("canCreateNewConnections")
) {
nativeEvent.preventDefault();
nativeEvent.stopPropagation();
Expand Down
2 changes: 1 addition & 1 deletion src/stories/Playground/GraphPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const config: HookGraphParams = {
canZoomCamera: true,
canDuplicateBlocks: false,
canChangeBlockGeometry: ECanChangeBlockGeometry.ALL,
canCreateNewConnections: false,
canCreateNewConnections: true,
showConnectionArrows: false,
scaleFontSize: 1,
useBezierConnections: true,
Expand Down

0 comments on commit cc1ffe6

Please sign in to comment.