mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore(codegen): use offsetX instead of clientX for positioned clicks (#9521)
This commit is contained in:
parent
235cd10a43
commit
2d3d733af7
@ -572,10 +572,9 @@ function positionForEvent(event: MouseEvent): Point |undefined {
|
||||
const targetElement = (event.target as HTMLElement);
|
||||
if (targetElement.nodeName !== 'CANVAS')
|
||||
return;
|
||||
const rect = targetElement.getBoundingClientRect();
|
||||
return {
|
||||
x: event.clientX - rect.left,
|
||||
y: event.clientY - rect.top,
|
||||
x: event.offsetX,
|
||||
y: event.offsetY,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user