Hello,
I am trying to allow users to drag connector annotations in a diagram with orthogonal connectors.
The annotation appears draggable, but after dropping it always returns to its original position.
I am configuring the annotation as follows:
const annotation: AnnotationModel = {
content: getRoleType(item.roletype),
constraints:
AnnotationConstraints.Drag |
AnnotationConstraints.Interaction |
AnnotationConstraints.Select,
horizontalAlignment: 'Left',
verticalAlignment: 'Top',
};
And the connector constraints are set to:
constraints: ConnectorConstraints.Default & ~(ConnectorConstraints.DragSourceEnd | ConnectorConstraints.DragTargetEnd),
The function that creates the connectors is located in the attached file.
I am using "@syncfusion/ej2-react-diagrams": "^32.1.24"
Is it possible to drag connector annotations and keep their position?
If so, how should this be implemented?
Thank you for your help.
Hi,
Thanks for reaching out. Based on the update and the code snippet you provided, we tried to replicate the reported behavior where an annotation, after being interacted with and moved, returns to its original position after the drop (mouse up). However, we were not able to reproduce the issue on our side.
Additionally, we confirm that it is possible to drag connector annotations and retain their updated positions. Please refer to the sample we used for testing and the video demonstration attached.
To assist you further, please provide a minimal issue replication sample from your side or modify the sample we previously shared.
Sample link:
https://stackblitz.com/edit/react-yxbsavc7?file=index.js
Regards,
Moulidharan
Hello,
Thank you for checking and for confirming that dragging connector annotations is supported.
With your sample I was able to identify the cause on my side. The issue was related to using DiagramTools.ZoomPan in tool={DiagramTools.ZoomPan | DiagramTools.Default}
After changing it to tool={DiagramTools.Default} dragging of annotations works correctly.
Thanks for the sample and support.
Regards,
Petr
Hi Petr Herynek,
Thanks for the update! We're glad to hear you identified the cause and that annotation dragging now works correctly after adjusting the tool settings. If you need any further assistance, feel free to reach out. we’re always happy to help.
Regards,
Moulidharan