Closed CrackerakiUA closed 7 years ago
If the draggable is also clickable (ng-click, ng-dblclick) the script wont react. What do you mean by that?
Also curious about conditionally preventing going to the href, in the case that the draggable element is an <a>
element.
I overcame it by adding ng-drag-start and ng-drag-stop handlers on dragged element.
ng-drag-start handler sets isDragging auxiliary property to true ng-drag-stop handler sets isDragging auxiliary property to false (do it in a timeout to occur after current digest cycle)
ng-click handler executes only in case isDragging is false.
Works for me.
@MichalJakubeczy how did you manage to get the ng-click to work?
@sauliuni have an variable which get true when drag start, and get false when drag ends on timeout something like 300ms. On ngClick check that variable.
i have ng-click on the ng-drag element, when i am starting to move the element it's everything ok, but when i stop it, that element activate my ng-click, how can i avoid that ng-click?