-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
cat: event-handlingstatus: PR proposedan active pull request should fix this issuean active pull request should fix this issue
Description
Currently Paper.js isn't listening to mouse events (mousedown
, mousemove
, mouseup
) for practically any device supporting ontouchstart
. This is causing clicks coming from mice connected to tablets or phones to not be detected by Paper.js tools.
Lines 1079 to 1090 in 56d153a
mousedown = 'touchstart'; | |
mousemove = 'touchmove'; | |
mouseup = 'touchend touchcancel'; | |
// Do not add mouse events on mobile and tablet devices | |
if (!('ontouchstart' in window && navigator.userAgent.match( | |
/mobile|tablet|ip(ad|hone|od)|android|silk/i))) { | |
// For non pointer events browsers and mixed browsers, like chrome | |
// on Windows8 touch laptop. | |
mousedown += ' mousedown'; | |
mousemove += ' mousemove'; | |
mouseup += ' mouseup'; | |
} |
I'm creating a PR to remove the check and listen to both touch and mouse events instead of excluding mouse on touch devices.
Description/Steps to reproduce
- Create a tool using a mouse event
- Click using a mouse connected to a touch device, the event will not be detected
Link to reproduction test-case
https://plnkr.co/edit/vUzAv72ZNODG3aSG
Expected result
Yellow circle should move to the pointer location
Additional information
Tested on iOS & iPadOS 15, should be reproducible on other versions of iOS and Android tablets.
Metadata
Metadata
Assignees
Labels
cat: event-handlingstatus: PR proposedan active pull request should fix this issuean active pull request should fix this issue