How can I prevent dragging of elements selected by a port when validateMagnet is false? #2877
-
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+ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With this demo in mind you can specify
|
Beta Was this translation helpful? Give feedback.
With this demo in mind you can specify
validateMagnet
callback as follows:preventDefaultInteraction()
shows to the paper that it should not trigger interactivity when this event is fired.