diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index a8f60a1fb..2202a4b47 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -345,7 +345,11 @@ class PDFFindController { this._calculateWordMatch(query, pageIndex, pageContent, entireWord); } - this._updatePage(pageIndex); + // When `highlightAll` is set, ensure that the matches on previously + // rendered (and still active) pages are correctly highlighted. + if (this._state.highlightAll) { + this._updatePage(pageIndex); + } if (this._resumePageIdx === pageIndex) { this._resumePageIdx = null; this._nextPageMatch();