Skip to content

[Bug]: Halo plugin uses element root instead of specified magnet as link source, causing misaligned links (especially visible with long port names) #3124

@Tilang

Description

@Tilang

Current versus expected behaviour

When using the Halo plugin to create a link from a specific magnet (e.g., a named port), the resulting link does not originate from that magnet. Instead, it incorrectly uses the center of the entire element’s root as the source point. This leads to visually broken connections—particularly noticeable when the port has a long name or is positioned far from the element’s center—making the link appear to start from empty space.

Root Cause:

The getLinkEnd function in the Halo plugin returns a selector string (e.g., .port[data-port="very-long-port-name"]). However, LinkView.prototype.findAnchor expects an anchor definition (or an object containing id and magnet), not a raw selector. Because of this mismatch, JointJS falls back to treating the source as { id: 'element-id' } without a magnet, which defaults to the element’s bounding box center.

Steps to reproduce

1.Create an element with a port that has a long name (e.g., "very-long-port-name-for-testing"), styled so the port is visibly offset from the element center.
2.Enable the Halo plugin on the element.
3.Use the Halo handle to drag a new link from that port.
4.Complete the link creation.

Version

4.0.0

What browsers are you seeing the problem on?

Chrome

What operating system are you seeing the problem on?

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions