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

Pass event as argument to detectTap to avoid errors on some legacy firefox versions #12

Open
j0Shi82 opened this issue Sep 30, 2020 · 0 comments · May be fixed by #13
Open

Pass event as argument to detectTap to avoid errors on some legacy firefox versions #12

j0Shi82 opened this issue Sep 30, 2020 · 0 comments · May be fixed by #13

Comments

@j0Shi82
Copy link

j0Shi82 commented Sep 30, 2020

The plugin is currently throwing errors on some legacy Firefox versions:

ReferenceError: event is not defined

The issue is the function detectTap that gets called from onmouseup events. Since event is not defined within the function scope, it looks up window.event instead. It works on most browsers, but we're getting errors on some legacy Firefox versions where window.event is unsupported or bugged and returns undefined, causing the error.

I think it would be better to pass event as an argument to detectTap. This would also be consistent with how the rest of the code is structured, so I guess this is simply an oversight? Either way, relying on window.event is not recommended: https://developer.mozilla.org/en-US/docs/Web/API/Window/event

Cheers!

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