1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #18374 from calixteman/test_editor_visible

Make sure the editor is visible before getting its rect
This commit is contained in:
Tim van der Meij 2024-07-04 11:14:27 +02:00 committed by GitHub
commit 03a0500dcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -135,7 +135,7 @@ function getSelector(id) {
async function getRect(page, selector) {
// In Chrome something is wrong when serializing a `DomRect`,
// so we extract the values and return them ourselves.
await page.waitForSelector(selector);
await page.waitForSelector(selector, { visible: true });
return page.$eval(selector, el => {
const { x, y, width, height } = el.getBoundingClientRect();
return { x, y, width, height };