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

pointer events registered with deprecated MS prefix in IE 11 #753

Closed
rd-secretstuff opened this issue Jan 23, 2015 · 2 comments
Closed

pointer events registered with deprecated MS prefix in IE 11 #753

rd-secretstuff opened this issue Jan 23, 2015 · 2 comments

Comments

@rd-secretstuff
Copy link

In the current version it decides to use the MS prefixed pointer events event on Internet Explorer 11,
It uses MSPointerDown MSPointerMove MSPointerUp MSPointerCancel instead of pointerdown pointermove pointerup pointercancel event though the prefixed ones are deprecated.

This is because the test for prefixed input is like this :

// IE10 has prefixed support, and case-sensitive
if (window.MSPointerEvent) {
    POINTER_ELEMENT_EVENTS = 'MSPointerDown';
    POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
}

IE 11 however has both MSPointerEvent and PointerEvent defined (probably for backward compatibility).
And will behind the scenes translate the MS prefixed pointer events to the non MS prefixed ones.
This (currently) doesn't pose a problem for hammer.js directly, but if hammer.js is combined with another library (for example webcomponents.js), it will fail to work because the registered event will be MSPointerDown while the actual event that is being send is mousedown

The test for PointerEvent should probably be like this :

// IE10 has prefixed support, and case-sensitive
if (window.MSPointerEvent && !window.PointerEvent) {
    POINTER_ELEMENT_EVENTS = 'MSPointerDown';
    POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
}

This way it will only use the prefixed versions when the non prefixed ones don't exist

@miguelmota
Copy link

I'm using webcomponents.js and ran into the issue @rd-secretstuff mentioned but fortunately his solution worked wonderfully.

Pull Request #782

@arschmitz
Copy link
Contributor

@rd-secretstuff Thank you for reporting this yes this needs to be updated. We are just ramping up development here again and will be sure to get this fixed!

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

No branches or pull requests

4 participants