How can I prevent dragging of elements selected by a port when validateMagnet is false? #2877
Answered
by
Geliogabalus
james-ep01
asked this question in
Q&A
IntroductionI know that if validateMagnet is not normal, return false, and then you can't draw links on the port. However, what I want to implement is to return false, display a message, and prevent dragging using the impossible port of the element. The image becomes strange when the user drags the impossible port. If the user tries to create a link on a port that cannot be linked, I want to display an error message and prevent dragging of elements on that port. What should I do in this case? Steps to reproduceNo response Restrictions & ConstraintsNo response Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS, JointJS+ |
Answered by
Geliogabalus
Feb 13, 2025
Replies: 1 comment 1 reply
|
With this demo in mind you can specify
|
1 reply
Answer selected by
Geliogabalus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With this demo in mind you can specify
validateMagnetcallback as follows:preventDefaultInteraction()shows to the paper that it should not trigger interactivity when this event is fired.