Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #73 from devbridge/72-refactor-getcoordinates-method
Browse files Browse the repository at this point in the history
Change focus() to _scrollIntoViewIfNeeded() in getCoordinates method.
  • Loading branch information
ernestas-zekas authored Oct 26, 2020
2 parents 8daa302 + 9a7d371 commit 19e1633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class Element {

async getCoordinates(xOffset = null, yOffset = null) {
const elementHandle = await this.wait();
await elementHandle.focus();
await elementHandle._scrollIntoViewIfNeeded();
const rect = await elementHandle.boundingBox();
const x = xOffset !== null ? xOffset : rect.width / 2;
const y = yOffset !== null ? yOffset : rect.height / 2;
Expand Down

0 comments on commit 19e1633

Please sign in to comment.