Ensure we support the common touch and pointer event properies #3104
|
It would be great if we had a way to make every property of the original event available on the jQuery one with O(1) overhead with regards to the number of properties but that's not possible without ES2015 Proxies, unfortunately. :( |
|
Proxy itself if pretty slow, but of course defineProperty is slow too. Ideally we'd be able to have |
Could you share which browsers are problematic here? |
|
Strange day, I can't type into either jsbin or jsfiddle. Here's a codepen: http://codepen.io/anon/pen/aNPgyg?editors=0010 Chrome gives "illegal invocation", Edge gives "invalid calling object", Firefox gives "TypeError: 'get type' called on an object that does not implement interface Event." I thought for sure that one of those three actually worked last time I tried it. The |
|
I saw the PR before, but just now noticed this issue. We should add |
|
I'm conflicted about how far to go with this. We were trying to avoid setting an hook API in concrete for 3.0.0 so we could find out what is out there. This was just to prevent immediate pain from people using those plugins. Most people using Pointer Events will be using PEP so adding those pointerId won't help them. Or will it? Can you take advantage of this in PEP and if so what would you like to see? For jQuery4 we need to figure out how to get out of the event object hacking business. |
|
Sorry for the long delay, this got buried in my inbox :-/
It will definitely help people using PEP. We wouldn't take advantage of this inside PEP, but it will allow users to use We do defer listing which properties will work on I'd love to see |
The two plugins I found that mess with event properties and might be popular are these:
https://github.com/aarongloege/jquery.touchHooks
https://github.com/timmywil/jquery.event.pointertouch
Rather than waiting for people to report a problem, let's be sure we added the relevant properties here. In particular,
changedTouchesandtouches. By the time we remove pageX/Y we will still be way ahead on size.