mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +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:
commit
03a0500dcf
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ function getSelector(id) {
|
||||||
async function getRect(page, selector) {
|
async function getRect(page, selector) {
|
||||||
// In Chrome something is wrong when serializing a `DomRect`,
|
// In Chrome something is wrong when serializing a `DomRect`,
|
||||||
// so we extract the values and return them ourselves.
|
// so we extract the values and return them ourselves.
|
||||||
await page.waitForSelector(selector);
|
await page.waitForSelector(selector, { visible: true });
|
||||||
return page.$eval(selector, el => {
|
return page.$eval(selector, el => {
|
||||||
const { x, y, width, height } = el.getBoundingClientRect();
|
const { x, y, width, height } = el.getBoundingClientRect();
|
||||||
return { x, y, width, height };
|
return { x, y, width, height };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue