From 50f73092e1f74e0fb1ea8d40763a5fba709c00c0 Mon Sep 17 00:00:00 2001 From: Phillip Johnsen Date: Thu, 30 Jul 2020 09:53:38 +0200 Subject: [PATCH] Populate the find field with the search query when URL has #search hash These changes improves the existing search functionality triggered when the URL contains a `#search` hash. In addition to performing the actual search immediately like before, this will ensure the search text field inside the find bar gets populated with the text currently being searched for. --- web/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/app.js b/web/app.js index e84a2af22..7a9ce9dfe 100644 --- a/web/app.js +++ b/web/app.js @@ -2349,6 +2349,10 @@ function webViewerFindFromUrlHash(evt) { highlightAll: true, findPrevious: false, }); + + if (PDFViewerApplication.findBar) { + PDFViewerApplication.findBar.findField.value = evt.query; + } } function webViewerUpdateFindMatchesCount({ matchesCount }) {