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

Commit ef02daa

Browse files
committed
Dispatch lostpointercapture and gotpointercapture events with a pointerId
1 parent 0a3118a commit ef02daa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/dispatcher.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@
286286
this.releaseCapture(this.captureInfo.id);
287287
}
288288
this.captureInfo = {id: inPointerId, target: inTarget};
289-
var e = new PointerEvent('gotpointercapture', { bubbles: true });
289+
var e = document.createEvent('Event');
290+
e.initEvent('gotpointercapture', true, false);
291+
e.pointerId = inPointerId;
290292
this.implicitRelease = this.releaseCapture.bind(this, inPointerId);
291293
document.addEventListener('pointerup', this.implicitRelease);
292294
document.addEventListener('pointercancel', this.implicitRelease);
@@ -295,7 +297,9 @@
295297
},
296298
releaseCapture: function(inPointerId) {
297299
if (this.captureInfo && this.captureInfo.id === inPointerId) {
298-
var e = new PointerEvent('lostpointercapture', { bubbles: true });
300+
var e = document.createEvent('Event');
301+
e.initEvent('lostpointercapture', true, false);
302+
e.pointerId = inPointerId;
299303
var t = this.captureInfo.target;
300304
this.captureInfo = null;
301305
document.removeEventListener('pointerup', this.implicitRelease);

0 commit comments

Comments
 (0)