Combine onHover ports and onHover adornments

Hello,

I try to make a node that has ports only shown when the node is hovered with the function makePort (https://gojs.net/latest/samples/draggableLink.html) and also a button that has to be outside the node and only shown when the node is hovered.

Here is the codesandbox: https://codesandbox.io/s/pensive-breeze-9y3b0

As you can see, there is no way to click on the button Hi as it disappear each time the mouse leaves the node, and also it seems like the button onclick doesn’t work (no alert). How could I fix that? Thank you for your answer.

This sample demonstrates what I think you want to do:
https://gojs.net/latest/samples/hoverButtons.html

I suspect that the problem in your code is that the mouse is “leaving” the Node when the Adornment is shown.