Issue with isValidConnection and Handling Same Handle Types in Custom Nodes #1744
Closed
Jarvis-Liu
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
You can set |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I’ve encountered an issue with the
isValidConnection
implementation while working with custom nodes. Here’s the scenario:type: 'source'
andtype: 'target'
respectively.source
tosource
) can be connected. However, my intention is to allow onlysource
to connect totarget
, similar to the behavior in the official demo withnodeType: 'default'
. In the demo, if you try to connectsource
tosource
, the connection automatically redirects to the correcttarget
handle.I’m confused about why this behavior works seamlessly with
nodeType: 'default'
but not in my custom implementation. To address this, I attempted to useisValidConnection
to validate the connection based on the handle types. However, I noticed that theconnection
parameter only provides thehandle
IDs, not their types. This forces me to look up the handle types by searching through the original data using thehandle
IDs, which feels overly cumbersome for a simple validation.Questions/Suggestions
connection
parameter to includesourceHandleType
andtargetHandleType
? This would make it much easier to validate connections without needing to manually maphandle
IDs to their types.isValidConnection
incorrectly? Is there a more straightforward way to enforcesource
-to-target
connections without resorting to manual lookups?Any guidance or clarification on this would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions