diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js index 815a3a93c..fd3d9d17d 100644 --- a/web/pdf_find_controller.js +++ b/web/pdf_find_controller.js @@ -510,7 +510,7 @@ class PDFFindController { // When searching starts, this method may be called before the `pageMatches` // have been counted (in `_calculateMatch`). Ensure that the UI won't show // temporarily broken state when the active find result doesn't make sense. - if (current > total) { + if (current < 1 || current > total) { current = total = 0; } return { current, total, };