Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

"lostpointercapture" doesn't fire when releasing multiple pointer captures #188

Closed
stuartpb opened this issue May 15, 2015 · 8 comments
Closed

Comments

@stuartpb
Copy link
Contributor

Tested on my Acer C720P Chromebook, by touching two elements that setPointerCapture on pointerdown, and trust implicit pointer release for losing the capture - note how after "up", "out", and "leave", lostpointercapture does not fire for pointerId 3:

pointerover 2
pointerdown 2
gotpointercapture 2
pointerover 3
pointerdown 3
gotpointercapture 3
pointerout 2
pointerleave 2
pointerover 2
pointerenter 2
pointerout 3
pointerleave 3
pointerover 3
pointerenter 3
pointerup 2
pointerout 2
pointerleave 2
lostpointercapture 2
pointerup 3
pointerout 3
pointerleave 3
@stuartpb
Copy link
Contributor Author

This was on event listeners for two filled SVG paths, if it matters (#134).

@stuartpb
Copy link
Contributor Author

Also, it appears to be actually not releasing the pointer capture, beyond just not firing the event.

@stuartpb
Copy link
Contributor Author

The logic in https://github.com/jquery/PEP/blob/da854e479653a6ac367a3f031568923e09871a2e/src/dispatcher.js#L308-310 looks bugged. It's setting a listener across the entire document to release the pointer capture when any pointer is released? And it's only tracking one implicit release across the entire dispatcher?

(This also explains why testing with multitouch causes a leak of event listeners on document.)

@stuartpb
Copy link
Contributor Author

And shouldn't captureInfo (which would more clearly be named pointerCaptureTargetOverrides to match the spec) be a PointerMap? And why is there a PointerMap instead of just using a polyfillable Map?

@stuartpb
Copy link
Contributor Author

It seems to me that implicit pointer cature release checks would make more sense as part of the dispatchers around https://github.com/jquery/PEP/blob/da854e479653a6ac367a3f031568923e09871a2e/src/dispatcher.js#L162 and https://github.com/jquery/PEP/blob/da854e479653a6ac367a3f031568923e09871a2e/src/dispatcher.js#L182, checking for a pointer capture target override and then releasing the capture.

@stuartpb
Copy link
Contributor Author

I submitted #190 to address the PointerMap concern, and am currently rewriting the dispatcher's implementation of pointer capture to address the original issue (as well as #177, potentially).

@stuartpb
Copy link
Contributor Author

stuartpb commented Sep 2, 2015

I've been working on non-pointer-oriented projects for the last three months - I'm drifting back into pointer-oriented projects now, so I'm putting this back on my plate.

@patrickhlauke
Copy link
Collaborator

PEP has now entered emeritus status at the OpenJS Foundation. This repository is now archived.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants