We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ab6522 commit efd505aCopy full SHA for efd505a
1 file changed
e2e/testcafe-devextreme/playwright-helpers/screenshotUtils.ts
@@ -6,13 +6,17 @@ export async function getLocatorScrollClip(
6
return locator.evaluate((el) => {
7
const r = el.getBoundingClientRect();
8
const width = Math.max(el.scrollWidth, el.offsetWidth);
9
- const height = Math.max(el.scrollHeight, el.offsetHeight);
+ const rawHeight = Math.max(el.scrollHeight, el.offsetHeight);
10
+ const vh = window.innerHeight;
11
+ const y = Math.max(0, Math.round(r.y));
12
+ const maxHeight = vh - y;
13
+ const height = Math.min(rawHeight, maxHeight);
14
if (width === Math.round(r.width) && height === Math.round(r.height)) {
15
return null;
16
}
17
return {
18
x: Math.round(r.x),
- y: Math.round(r.y),
19
+ y,
20
width,
21
height,
22
};
0 commit comments