Open kasparsz opened 6 years ago
Just wanted to add that the click counter in your example is also incremented when I'm using my touchpad on my MacBook Pro 15" TouchBar (MLH32LL/A)
I think this is what I have been getting.
If I remove :
if (e.target.nodeName === 'A') {
this.drag.preventClick = true;
}
Then I can click on the link. This is in the code to prevent navigating to the link if the user drags the slideshow over a link.
Issue is only with Magic Mouse, couldn't repeat with touch pads or touch devices.
Issue: When carousel items have links and user clicks on it without dragging, with regular mouse "click" event doesn't have "defaultPrevented" because mousemove event wasn't triggered so it's not considered a "drag". With Magic Mouse "mousemove" events are triggered after "mousedown" even if mouse position (event.pageX) didn't changed, this breaks drag detection.
From what I have seen it's not always the case, if user didn't moved mouse between previous click and last click then "mousemove" events are not triggered, but that's irrelevant in this case.
Fiddle https://jsfiddle.net/kaszu/vyLgqzwd/ , problem can be repeated only with Magic Mouse.
Solution would be to check in "mousemoveHandler" if mouse has actually moved