mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-31 19:37:21 +02:00
Merge pull request #20903 from calixteman/fix_intermittent_setCaret
Wait to have all the spans in the text layer before trying to set the caret in integration tests
This commit is contained in:
commit
76bd6dc0dd
@ -717,6 +717,10 @@ async function firstPageOnTop(page) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setCaretAt(page, pageNumber, text, position) {
|
async function setCaretAt(page, pageNumber, text, position) {
|
||||||
|
// Wait for the text layer to finish rendering before trying to find the span.
|
||||||
|
await page.waitForSelector(
|
||||||
|
`.page[data-page-number="${pageNumber}"] .textLayer .endOfContent`
|
||||||
|
);
|
||||||
await page.evaluate(
|
await page.evaluate(
|
||||||
(pageN, string, pos) => {
|
(pageN, string, pos) => {
|
||||||
for (const el of document.querySelectorAll(
|
for (const el of document.querySelectorAll(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user