mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
When the search query changes, regardless of the search command, always re-calculate matches (bug 1030622)
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1030622
This commit is contained in:
parent
2194aef03e
commit
8afb550218
1 changed files with 7 additions and 2 deletions
|
@ -113,7 +113,7 @@ class PDFFindController {
|
|||
executeCommand(cmd, state) {
|
||||
const pdfDocument = this._pdfDocument;
|
||||
|
||||
if (this._state === null || this._shouldDirtyMatch(cmd)) {
|
||||
if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
|
||||
this._dirtyMatch = true;
|
||||
}
|
||||
this._state = state;
|
||||
|
@ -198,7 +198,12 @@ class PDFFindController {
|
|||
return this._normalizedQuery;
|
||||
}
|
||||
|
||||
_shouldDirtyMatch(cmd) {
|
||||
_shouldDirtyMatch(cmd, state) {
|
||||
// When the search query changes, regardless of the actual search command
|
||||
// used, always re-calculate matches to avoid errors (fixes bug 1030622).
|
||||
if (state.query !== this._state.query) {
|
||||
return true;
|
||||
}
|
||||
switch (cmd) {
|
||||
case 'findagain':
|
||||
const pageNumber = this._selected.pageIdx + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue