Merge pull request #2893 from wbkd/fix/handle-connectable
fix(handles): check if handle is connectable closes #2869
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
'@reactflow/core': major
|
'@reactflow/core': patch
|
||||||
---
|
---
|
||||||
|
|
||||||
track modifier keys on useKeypress
|
track modifier keys on useKeypress
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@reactflow/core': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: check if handle is connectable
|
||||||
@@ -104,9 +104,10 @@ export function isValidHandle(
|
|||||||
|
|
||||||
// in strict mode we don't allow target to target or source to source connections
|
// in strict mode we don't allow target to target or source to source connections
|
||||||
const isValid =
|
const isValid =
|
||||||
connectionMode === ConnectionMode.Strict
|
handleToCheck.classList.contains('connectable') &&
|
||||||
|
(connectionMode === ConnectionMode.Strict
|
||||||
? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')
|
? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')
|
||||||
: handleNodeId !== fromNodeId || handleId !== fromHandleId;
|
: handleNodeId !== fromNodeId || handleId !== fromHandleId);
|
||||||
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
result.isValid = isValidConnection(connection);
|
result.isValid = isValidConnection(connection);
|
||||||
|
|||||||
Reference in New Issue
Block a user