Skip to content

Commit

Permalink
(js) Ignore mouse events in scrollbars of Month
Browse files Browse the repository at this point in the history
Firefox is bubbling the mouse down event on scrollbars so it has to be
ignored for proper drag'n'drop.

Fixes #3990.
  • Loading branch information
cgx committed Jan 30, 2017
1 parent 4143a23 commit abccdd3
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -81,10 +81,20 @@
}

function onDragDetect(ev) {
var dragMode, pointerHandler;
var dragMode, pointerHandler, hasVerticalScrollbar, rect;

ev.stopPropagation();

hasVerticalScrollbar = ev.target.scrollHeight > ev.target.clientHeight + 1;

if (hasVerticalScrollbar) {
// Check if mouse click is inside scrollbar
rect = ev.target.getBoundingClientRect();
scrollableZone = rect.left + rect.width - 18;
if (ev.pageX > scrollableZone)
return;
}

dragMode = 'move-event';

if (scope.block && scope.block.component) {
Expand Down

0 comments on commit abccdd3

Please sign in to comment.