angular-dnd icon indicating copy to clipboard operation
angular-dnd copied to clipboard

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

Open Dimanoid opened this issue 10 years ago • 9 comments

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

Dimanoid avatar Sep 20 '15 13:09 Dimanoid

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

Tuch avatar Sep 20 '15 14:09 Tuch

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 :)

Dimanoid avatar Sep 20 '15 18:09 Dimanoid

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

Tuch avatar Sep 21 '15 09:09 Tuch

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.

Dimanoid avatar Sep 23 '15 13:09 Dimanoid

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?

hebedombiu avatar Oct 16 '15 10:10 hebedombiu

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.

Dimanoid avatar Oct 21 '15 16:10 Dimanoid

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

Tuch avatar Oct 21 '15 17:10 Tuch

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.

k-one-o-two avatar Oct 28 '15 11:10 k-one-o-two

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

Tuch avatar Oct 28 '15 12:10 Tuch