clientIO / joint

A proven SVG-based JavaScript diagramming library powering exceptional UIs
https://jointjs.com
Mozilla Public License 2.0
4.45k stars 841 forks source link

fix(dia.ElementView): fix to support port id as numbers #2624

Closed kumilingus closed 3 weeks ago

kumilingus commented 3 weeks ago

Description

It is currently possible to set the port ID to a number.

element.addPort({ port: 123 });

However, the user cannot connect to the port through the user interface. This is because internally we are looking for a port with an id as the string "123", which could not be found.

This PR ensures that the link connection works as expected and that the port ID stored in the link model is of the correct type.

typeof link.target().port === 'number'