Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix(dragSelect): ignore right-clicks for drag/drop (#585)

* ignore drag and drop events with a right click

* fix(dragSelect): ignore right-clicks for drag/drop

* Revert "fix(dragSelect): ignore right-clicks for drag/drop"

This reverts commit 63bb6f6.
  • Loading branch information...
bwobbones authored and mattlewis92 committed Apr 24, 2017
1 parent e8ffc2b commit e0a51b66b6ebe8b056d723484183e0d54b486113
Showing with 10 additions and 1 deletion.
  1. +1 −1 src/directives/mwlDragSelect.js
  2. +9 −0 test/unit/directives/mwlDragSelect.spec.js
@@ -8,7 +8,7 @@ angular

function handleMouseEvent(callbackName) {
return function(event) {
if (callbackName) {
if (callbackName && event.button !== 2) {
$parse(callbackName)($scope);
$scope.$apply();
}
@@ -54,6 +54,15 @@ describe('mwlDragSelect directive', function() {
expect(scope.onEnd).to.have.been.calledOnce;
});

it('should not fire drag events when the right mouse button is pressed', function() {
var event = document.createEvent('Event');
event.initEvent('mousedown', true, true);
event.button = 2;
elm[0].dispatchEvent(event);

expect(scope.onStart).not.to.have.been.called;
});

});

describe('isEnabled = false', function() {

0 comments on commit e0a51b6

Please sign in to comment.
You can’t perform that action at this time.