How to prevent temporary link going inside of node?

How to prevent temporary link going inside of node?
When I click mouse down on the node and try to draw link from that node, the temporary link can go inside of node.
I want to prevent this. I want temporary link to be only outside of node.
How to do this?
Regards

Do you have a screenshot of what’s happening and what you want? It’s not clear from your description exactly what you do and don’t want.

Plz see this video:
https://www.useloom.com/share/1fc6462f13454a18905db0b3465ed098
You can find temporary link go inside of node.
I’d like to prevent this.
How to do this?

That’s not typical behavior for any of the node templates in our samples. What is your node template?

I tried on this demo you made.
https://gojs.net/extras/clickInsertsPoint.html

And I found same issue in this sample too.

So I think it’s typical behavior. How to prevent this?
Thanks

It does happen if the port has fromLinkableSelfNode and toLinkableSelfNode false. But one does not see that behavior when reflexive links are allowed.

The standard behavior for LinkingTool when a valid link cannot be made at the current mouse point is to have the temporary link go to the mouse and follow it around. When the mouse point comes close enough to a valid port, it snaps to that port. Both behaviors are implemented by setting the location of the LinkingTool.temporaryToNode or LinkingTool.temporaryFromNode, depending on which logical direction the link is being drawn.

You can implement what you want by overriding LinkingBaseTool | GoJS API to set the location of the tempnode argument to be where you would want it to be, presumably somewhere outside of the node.

Thank you very much. But i don’t know gojs well. So can you plz send me simple example code snippet for this? :-)
Thanks.

I think you’re far enough along to be able to figure it out yourself. If you run into problems, post what you have tried and what exactly the problem is, and we can help you.