Link to hidden node jumps to group

Good day. I have two nodes and link between them. One of the nodes is inside group. Another one has no group. When node inside group become invisible link jumps to that group.
Is there any out-of-the-box solution to prevent this behavior? If node is invisible I want connected link to be invisible too.
GoJS v2.1.23

I believe you will need to define a Node subclass that overrides the Node.findVisibleNode method. The override needs to return null if calling Node.isVisible returns false.

Remember to make use of your new JavaScript class by referring to it in your node template instead of go.Node. There is an example of overriding this method in, although that example has different requirements and is more complicated than what you need.

Thanks, walter. It’s a pity method findVisibleNode is absent in docs.