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
|
||||
// has been selected.
|
||||
|
||||
if (textLayerMode === TextLayerMode.ENABLE_PERMISSIONS) {
|
||||
if (
|
||||
this.#getAllTextInProgress ||
|
||||
textLayerMode === TextLayerMode.ENABLE_PERMISSIONS
|
||||
) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
this.#getAllTextInProgress = true;
|
||||
|
||||
// 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.
|
||||
|
||||
if (this.#getAllTextInProgress) {
|
||||
return;
|
||||
}
|
||||
this.#getAllTextInProgress = true;
|
||||
|
||||
// Select all the document.
|
||||
const savedCursor = this.container.style.cursor;
|
||||
this.container.style.cursor = "wait";
|
||||
|
Loading…
Reference in New Issue
Block a user