From 4fa36f614b131c587c1399b84c002f6f0bf50b8c Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Tue, 19 Nov 2024 20:27:54 +0000 Subject: [PATCH] Don't render previous search results Fixes https://forums.zotero.org/discussion/119698/ghost-search-results-in-the-pdf-reader --- src/pdf/page.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pdf/page.js b/src/pdf/page.js index b43ec300..077112e3 100644 --- a/src/pdf/page.js +++ b/src/pdf/page.js @@ -458,10 +458,10 @@ export default class Page { } _renderFindResults() { - if (!this.layer._findController) { - return; - } - if (!this.layer._findController.highlightMatches) { + if (!this.layer._findController + || !this.layer._findController.highlightMatches + || !this.layer._findController._matchesCountTotal + ) { return; } let { _pageMatchesPosition, selected } = this.layer._findController;