Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayheck committed May 4, 2024
1 parent 1b17abd commit 3813c10
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/client/automation/playback/click/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,22 @@ export default class ClickAutomation extends VisibleElementAutomation {
return this
._ensureElement(useStrictElementCheck)
.then(({ element, clientPoint, screenPoint, devicePoint }) => {
const boxes = element?.getClientRects();
let clientX;
let clientY;

if (boxes) {
clientX = boxes[0].x + boxes[0].width / 2;
clientY = boxes[0].y + boxes[0].height / 2;
}

eventArgs = {
point: clientPoint,
screenPoint: screenPoint,
element: element,
options: utils.extend({
clientX: clientPoint?.x,
clientY: clientPoint?.y,
clientX: clientX ?? clientPoint?.x,
clientY: clientY ?? clientPoint?.y,
screenX: devicePoint?.x,
screenY: devicePoint?.y,
}, this.modifiers),
Expand Down

0 comments on commit 3813c10

Please sign in to comment.