-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow pointer events to be used if supported #1810
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change, then good to go. Thanks!
6244701
to
cffd306
Compare
One other thing: Pointer events seem to break UI code that expects mouse events. Should pointer events have to be explicitly enabled, or should there be a version bump of some sort, to indicate that this may change applications' behavior? |
@adroitwhiz could you explain how they break things? I don't quite understand the problem |
If there's external code that expects you to click on a canvas (e.g. an eyedropper tool, or dropdown that is supposed to close when you click on another element), for some reason it won't receive those "click" events if pointer events are enabled. I ran into this when testing out this change on a real-world codebase. |
Looks like the "pointer events break mouse events" behavior was talked about a bit here. |
39b63a1
to
b90a711
Compare
4a6bf6f
to
0f4afc5
Compare
Would this potentially fix #1959? |
@danrha yes I think so. I'm doing this same change locally for easier differentiation between stylus, touch and mouse inputs |
What is the status with this PR @lehni? We've run into an issue that requires pointer support, a drawing app for use with iPad and Wacom tablets that are listening for pointer events (eyedropper, drawing, etc). Any chance we can get this pushed? |
I've found that the I've needed this to get the |
Description
This PR adds support for using pointer events instead of mouse/touch events if supported in the browser.
Previously, paper.js was testing for pointer event support by checking
navigator.pointerEnabled
, but that was removed from the pointer events spec back in 2013 and no longer implemented in modern browsers. Now it tests for the existence ofwindow.PointerEvent
.Related issues
Checklist
npm run jshint
passes)