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 proof of concept #1524
Conversation
Thanks for the PR! This looks promising to me. It looks like we need to focus on PEP for now, to get that ES3 compatible and to work in IE8+. Would also be nice to have a grunt QUnit plugin that uses PhantomJS 2.0+, since that should support I'd like to discuss this approach at the next jQuery UI team meeting (see http://meetings.jquery.org/ for schedule), before we put more work into this PR. Until then I hope you can dig deeper into PEP. |
Great, thank you for the feedback. I am digging into PEP and have started looking into the IE8 Event handling system. |
Since there was no issue for that, I just filed one: jquery-archive/PEP#174 - its rather vague, so you may need to bug Scott or others to provide more details. |
@bethge what iOS version / device combo did you run this on? When i try it on iOS 8 iPhone 6 draggable unit tests have 87 failures. Most of the failures appear to be legitimate. The demos do seem to work fine though, and the unit tests do pass on desktop safari. |
@arschmitz You are very much right. I must have mixed something up. Furthermore, Safari iOS (Simulator and iPhone 5s on iOS 8) gets stuck on the connectToSortable tests. I will look into it. |
I did some digging, focusing on the "draggable: core: element types" test case, as it appears to be the most simple drag interaction. Runs successfully in:
Fails in:
The test case simulates a mouse-based drag. For the successful setups, the clientX/Y and pageX/Y are identical, but for the failing setups, they are not. I have not figured out, if this is the cause or just a repercussion. I experience the same success and failure behavior for this test case for the current master (i.e. without PEP + pointerevents) with an iPhone 5s: The test succeeds in Chrome, but fails in Safari. Off the top of my head I would say either touch-based interactions need to be simulated for touch-based devices, or one goes with simulated pointer events. On a side note: The test case does run through successfully even for the failing setups, if breakpoints are set at each event trigger (I can only guess why that is). |
@bethge considering that the code now only binds pointer events, simulating those seems like the right thing to do. We must be able to rely on the polyfill for the mapping of mouse and touch events. |
The draggable, droppable and slider demos should work nicely on touch devices.
Few things were changed in
mouse.js
, just minor adaptions and the adding of thetouch-action
attribute to the widget.Phantomjs does not get along with PEP yet though. For the moment, I added a polyfill for phantom's missing
.bind()
function, but phantomjs is still missingMutationObservers
.The draggable in-browser unit test suite runs well on iOS (Chrome & Safari) and Android (Chrome) with a few pixels off here and there. On IE11, the unit tests on are not too happy, although the demos work fine.