Skip to content

Commit 426ffa5

Browse files
Alex Vinoberalexcjohnson
Alex Vinober
authored andcommitted
Restore dispatching 'click' on right-click
1 parent 0d99411 commit 426ffa5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/dragelement/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ dragElement.init = function init(options) {
104104

105105
if(options.prepFn) options.prepFn(e, startX, startY);
106106

107-
if(hasHover) {
107+
if(hasHover && (!e.buttons || (e.buttons && e.buttons !== 2))) {
108108
dragCover = coverSlip();
109109
dragCover.style.cursor = window.getComputedStyle(element).cursor;
110110
}

test/jasmine/tests/dragelement_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('dragElement', function() {
137137
expect(countCoverSlip()).toEqual(0);
138138

139139
mouseEvent('mouseup', this.x, this.y);
140-
expect(mockObj.handleClick).not.toHaveBeenCalled();
140+
expect(mockObj.handleClick).toHaveBeenCalled();
141141
});
142142

143143
it('should fire off click event when down/up without dragging', function() {

0 commit comments

Comments
 (0)