Hi Team,
I have added an adornment on a link, so when user hover on the link it will show a button and on mouseLeave I am removing the adornment. I am facing an issue while removing the adornment. Most of the time it works fine but when I move the mouse slowly from a link to a node (instead of moving to the canvas) adornment is not removed from the canvas. Though while debugging I found that it is removed from the link object and is giving null when I try to find the adornment on the link.
This is how it behave [last time +
icon stays on the link]
I am also updating 1 property of the link object [I even tried without that property update still the behavior is same]
mouseLeave: (_, obj) => {
// hide the adornment on mouse leave of adornment
const linkObject= (obj as any).adornedPart;
const linkData = linkObject.data;
linkData.$hover = false;
linkObject.updateTargetBindings();
if (!linkData.$activeContext) {
linkObject.removeAdornment(addName);
}
},
before and after removing the adornment in mouseLeave event
Thanks
Ankit