mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(pointer-events): listening to document
This commit is contained in:
@ -85,10 +85,10 @@ export class PointerEvents {
|
||||
return;
|
||||
}
|
||||
if (!this.rmMouseMove && this.pointerMove) {
|
||||
this.rmMouseMove = addEventListener(this.el.ownerDocument, 'mousemove', this.pointerMove, this.options);
|
||||
this.rmMouseMove = addEventListener(getDocument(this.el), 'mousemove', this.pointerMove, this.options);
|
||||
}
|
||||
if (!this.rmMouseUp) {
|
||||
this.rmMouseUp = addEventListener(this.el.ownerDocument, 'mouseup', this.bindMouseUp, this.options);
|
||||
this.rmMouseUp = addEventListener(getDocument(this.el), 'mouseup', this.bindMouseUp, this.options);
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,6 +130,10 @@ export class PointerEvents {
|
||||
}
|
||||
}
|
||||
|
||||
function getDocument(node: Node) {
|
||||
return node instanceof Document ? node : node.ownerDocument;
|
||||
}
|
||||
|
||||
export const POINTER_EVENT_TYPE_MOUSE = 1;
|
||||
export const POINTER_EVENT_TYPE_TOUCH = 2;
|
||||
|
||||
|
Reference in New Issue
Block a user