webdriverio 8.16.3 → 8.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"scrollIntoView.d.ts","sourceRoot":"","sources":["../../../src/commands/element/scrollIntoView.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,qBAAqB,GAAG,OAA+C,iBA0EnF"}
1
+ {"version":3,"file":"scrollIntoView.d.ts","sourceRoot":"","sources":["../../../src/commands/element/scrollIntoView.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,qBAAqB,GAAG,OAA+C,iBA2EnF"}
@@ -48,6 +48,8 @@ export async function scrollIntoView(options = { block: 'start', inline: 'neares
48
48
  let [windowX, windowY] = await browser.execute(() => [
49
49
  window.scrollX, window.scrollY
50
50
  ]);
51
+ const origScrollX = windowX;
52
+ const origScrollY = windowY;
51
53
  const origin = windowX === 0 && windowY === 0 ? this : undefined;
52
54
  windowX = elemRect.x <= viewport.width ? elemRect.x - 10 : viewport.width / 2;
53
55
  windowY = elemRect.y <= viewport.height ? elemRect.y - 10 : viewport.height / 2;
@@ -81,8 +83,8 @@ export async function scrollIntoView(options = { block: 'start', inline: 'neares
81
83
  windowY = 0;
82
84
  }
83
85
  else {
84
- deltaX = Math.round(deltaX - windowX);
85
- deltaY = Math.round(deltaY - windowY);
86
+ deltaX = Math.round(deltaX - origScrollX);
87
+ deltaY = Math.round(deltaY - origScrollY);
86
88
  windowX = Math.round(windowX);
87
89
  windowY = Math.round(windowY);
88
90
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webdriverio",
3
3
  "description": "Next-gen browser and mobile automation test framework for Node.js",
4
- "version": "8.16.3",
4
+ "version": "8.16.4",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -90,7 +90,7 @@
90
90
  "resq": "^1.9.1",
91
91
  "rgb2hex": "0.2.5",
92
92
  "serialize-error": "^11.0.1",
93
- "webdriver": "8.16.3"
93
+ "webdriver": "8.16.4"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "devtools": "^8.14.0"
@@ -100,5 +100,5 @@
100
100
  "optional": true
101
101
  }
102
102
  },
103
- "gitHead": "2c05558b0e4d6ecdca5eb7b0ed37d4a4e733b5a5"
103
+ "gitHead": "a812a91c2f937ee19588fe734bf6ae528b7d0c9a"
104
104
  }