use document.scrollingElement instead
This commit is contained in:
parent
0f876b38d2
commit
1c1fc2a592
|
|
@ -1024,10 +1024,10 @@ export class InjectedScript {
|
||||||
// createTouch does not accept clientX/clientY, so we have to use pageX/pageY.
|
// createTouch does not accept clientX/clientY, so we have to use pageX/pageY.
|
||||||
let pageX = t.pageX;
|
let pageX = t.pageX;
|
||||||
if (pageX === undefined && t.clientX !== undefined)
|
if (pageX === undefined && t.clientX !== undefined)
|
||||||
pageX = t.clientX + this.window.scrollX;
|
pageX = t.clientX + (this.document.scrollingElement?.scrollLeft || 0);
|
||||||
let pageY = t.pageY;
|
let pageY = t.pageY;
|
||||||
if (pageY === undefined && t.clientY !== undefined)
|
if (pageY === undefined && t.clientY !== undefined)
|
||||||
pageY = t.clientY + this.window.scrollY;
|
pageY = t.clientY + (this.document.scrollingElement?.scrollTop || 0);
|
||||||
return (this.document as any).createTouch(this.window, t.target ?? node, t.identifier, pageX, pageY, t.screenX, t.screenY, t.radiusX, t.radiusY, t.rotationAngle, t.force);
|
return (this.document as any).createTouch(this.window, t.target ?? node, t.identifier, pageX, pageY, t.screenX, t.screenY, t.radiusX, t.radiusY, t.rotationAngle, t.force);
|
||||||
};
|
};
|
||||||
const createTouchList = (touches: any) => {
|
const createTouchList = (touches: any) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue