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

context menu issue fixed #154

Merged
merged 3 commits into from
Sep 20, 2017
Merged

context menu issue fixed #154

merged 3 commits into from
Sep 20, 2017

Conversation

terrytilley
Copy link
Contributor

Issue

When viewing the slider on mobile and performing a long press on the image opens the context menu, once you exit the menu endtouchHandler() is never called. You are no longer able to swipe left or right because touch.count is equal to 2 and touch.multitouch is equal to true.

Fix

If the the context menu has been activated it will then call the touchendHandler() function.

@feimosi
Copy link
Owner

feimosi commented Sep 14, 2017

Thanks for the contribution!
Firstly, could you remove the package-lock.json file from the PR? I'll add it later myself.
Secondly (if you have some time), could you move this logic to a separate method (named contextmenuHandler and attach it in the bindEvents method? Just like other handlers.

@feimosi
Copy link
Owner

feimosi commented Sep 15, 2017

Great, we're almost there. bind attaches and detaches the event listener automatically and there's also slider available in the scope, so you can just write:

var contextmenuHandler = function() {
    touchendHandler();
};

bind(slider, 'contextmenu', contextmenuHandler);

Just test it, to be sure, thanks!

@feimosi feimosi added the bug label Sep 16, 2017
@terrytilley
Copy link
Contributor Author

That's is a much better solution 👍

All seems to be working so hopefully that is now fixed.

@feimosi
Copy link
Owner

feimosi commented Sep 20, 2017

Great, then I'm merging, thanks!

@feimosi feimosi merged commit 9e09fcc into feimosi:dev Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants