Merge pull request #16347 from Snuffleupagus/getAllTextInProgress-no-copy
Prevent incomplete copy-all behaviour while text-extraction is running (PR 16286 follow-up)
This commit is contained in:
commit
598408b7af
@ -691,19 +691,19 @@ class PDFViewer {
|
|||||||
// including this element so having it in the selection means that all
|
// including this element so having it in the selection means that all
|
||||||
// has been selected.
|
// has been selected.
|
||||||
|
|
||||||
if (textLayerMode === TextLayerMode.ENABLE_PERMISSIONS) {
|
if (
|
||||||
|
this.#getAllTextInProgress ||
|
||||||
|
textLayerMode === TextLayerMode.ENABLE_PERMISSIONS
|
||||||
|
) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.#getAllTextInProgress = true;
|
||||||
|
|
||||||
// TODO: if all the pages are rendered we don't need to wait for
|
// TODO: if all the pages are rendered we don't need to wait for
|
||||||
// getAllText and we could just get text from the Selection object.
|
// getAllText and we could just get text from the Selection object.
|
||||||
|
|
||||||
if (this.#getAllTextInProgress) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.#getAllTextInProgress = true;
|
|
||||||
|
|
||||||
// Select all the document.
|
// Select all the document.
|
||||||
const savedCursor = this.container.style.cursor;
|
const savedCursor = this.container.style.cursor;
|
||||||
this.container.style.cursor = "wait";
|
this.container.style.cursor = "wait";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user