Tuch / angular-dnd

Drag and Drop module for Super heroic 1.x AngularJS. Not jQueryUI. Touch supporting.
67 stars 25 forks source link

dnd-draggable == "true" prevents ng-click #34

Open Dimanoid opened 9 years ago

Dimanoid commented 9 years ago

Look at the example, if dnd-draggable set to true ng-click event never fired. http://embed.plnkr.co/w5vP9BK3xVztYhVBe2OI/preview

You need to implement something like dnd-drag-delay option or dnd-drag-delta to start dragging after a few ms after onmousedown or after cursor were moved a few pixels away from start point with button hold pressed. Something similar is done in angular-ui-tree https://github.com/angular-ui-tree/angular-ui-tree

Tuch commented 9 years ago

@Dimanoid hmm, in my case this working. Maybe i do something wrong? https://monosnap.com/file/CtfzF46MCkyiUHU0riYYpd1mYMpx3Z

Dimanoid commented 9 years ago

Stange but I cant reproduce it too on other computer. Sorry for disturbance.

Btw I think that has an option to delay start dragging is good anyway... Count it as a feature request :)

Tuch commented 9 years ago

@Dimanoid hmm, i think yes, but need more info about this point :) can you describe it?

Dimanoid commented 9 years ago

Please check JQueryUI API, it has both options. http://api.jqueryui.com/draggable/#option-delay http://api.jqueryui.com/draggable/#option-distance They are great to prevent accident start drag.

hebedombiu commented 9 years ago

I have the same problem. It begins drag when I click on element. And I can't check checkbox on child div. Win8, Chrome Which side I have to look, to fix that?

Dimanoid commented 9 years ago

Yep its really annoying when you start dragging instead of just click because of cursor micro-movement. Can you please fix it anytime soon? Those new options will resolve this nicely.

Tuch commented 9 years ago

@hebedombiu, @Dimanoid You mean like 'tollerance movement' option?

k-one-o-two commented 8 years ago

I think that I've found the problem on Chrome in Win10, this code seems to fix it:

mousemove: function (event) {
                if (event.movementX != 0 && event.movementY != 0) {
                    this.manipulator.progress(event);
                }
            }

The problem is that Chrome fires mousemove event with zero movents, which leads to the error described above.

Tuch commented 8 years ago

@k-one-o-two good idea, but bad supporting for movementX property...