I have an element of this type, the text field here is also a port, because I need the ability to create a connection by dragging any part
The problem is that when I start creating a line from the text port, the line runs into the second port
This happens because when a line is drawn, it is rendered lower in the list and has priority above
defaultLink: () => {
return new shapes.standard.Link({
z: -1,
attrs: {
line: {
stroke: "#70F",
strokeWidth: 2,
// transform: 'matrix(1, 0, 0, 1, 8, 0)',
targetMarker: {
d: null,
},
},
outline: {
stroke: "#70F",
strokeWidth: 2,
},
}
});
}
The Z attribute controls in what order the lines will be rendered after drawing, but not before.
Any ideas on how to make the lines render when drawing above the list or elsewhere? Perhaps somehow I can make it so that there is only one port, but I can also create a line from it when interacting with a text block?