diff --git a/e2e/studio.spec.ts b/e2e/studio.spec.ts index a699725..c792d71 100644 --- a/e2e/studio.spec.ts +++ b/e2e/studio.spec.ts @@ -220,12 +220,14 @@ const audit = (page: Page, label: string) => page.evaluate((label) => { if (r.width < 4 || r.height < 4) continue; const cs = getComputedStyle(el); if (cs.position === 'fixed' || cs.visibility === 'hidden') continue; - let p = el.parentElement, box: DOMRect | null = null; + let p = el.parentElement, box: DOMRect | null = null, scrollable = false; while (p && p !== document.body) { const ps = getComputedStyle(p); - if (/(hidden|auto|scroll|clip)/.test(ps.overflowX) || ps.position === 'fixed') { box = p.getBoundingClientRect(); break; } + if (/(auto|scroll)/.test(ps.overflowX)) { scrollable = true; break; } + if (/(hidden|clip)/.test(ps.overflowX) || ps.position === 'fixed') { box = p.getBoundingClientRect(); break; } p = p.parentElement; } + if (scrollable) continue; const left = box ? box.left : 0, right = box ? box.right : vw; if (r.left < left - 2 || r.right > right + 2) { const txt = (el.innerText || el.getAttribute('aria-label') || el.tagName).trim().replace(/\s+/g, ' ').slice(0, 40);