stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.91k stars 98 forks source link

Use polyfill Adapter on a device without force attribute #63

Closed davidshimjs closed 7 years ago

davidshimjs commented 7 years ago

I have found a device without force attribute on Touch Object. so, the pressure have to choose polyfill adapter in these devices.

stuyam commented 7 years ago

@davidshimjs sorry for taking long on getting back to you on this. Most of this looks solid to me, but I am wondering why the reordering of the conditions about which polyfill to use.

If mouse is above the pointer, then the pointer will never run on desktop. I had pointer above it because if it supports pointer then it should use that over mouse. Same with touch. I think the order should probably be, Pointer, Touch, Mouse. I see now that I have Mouse above Touch which is wrong because most mobile devices support mouse. But I don't think Touch should be above Pointer.

Let me know your thoughts and thanks again for the PR and fixing the bug I had in there with supportLegacyTest stuff 👍

stuyam commented 7 years ago

I am going to merge things now to clean things up but then take a look and let me know, I am going to change to the order of Pointer, Touch, Mouse.

stuyam commented 7 years ago

@davidshimjs Check the current version of master, I made a few tweaks, let me know how that works for you. If it is all good I will push a v2.1.1 update.

davidshimjs commented 7 years ago

@stuyam Sorry for late. Some android devices support the pointer event. http://caniuse.com/#search=pointer You can encounter the error when using these android devices. This is the reason why re-ordering of the conditions.

stuyam commented 7 years ago

Related #67