Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic Mouse click event on a link almost always has defaultPrevented #202

Open
kasparsz opened this issue Aug 14, 2018 · 2 comments
Open

Comments

@kasparsz
Copy 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

if (this.pointerDown && e.pageX != this.drag.startX) {
@wiseoldman
Copy link

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)

@JoshuaCrewe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants