mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[GV] Avoid to update the finder when the results aren't complete
At the beginning of a search we can an update can be triggered with 0 over 0 found matches. In the GeckoView context, we can't update the finder whenever we want but only when it has been required.
This commit is contained in:
parent
deb07aee06
commit
dc94b750de
2 changed files with 32 additions and 9 deletions
|
@ -1052,6 +1052,16 @@ class PDFFindController {
|
|||
}
|
||||
|
||||
#updateUIState(state, previous = false) {
|
||||
if (
|
||||
!this.#updateMatchesCountOnProgress &&
|
||||
(this.#visitedPagesCount !== this._linkService.pagesCount ||
|
||||
state === FindState.PENDING)
|
||||
) {
|
||||
// When this.#updateMatchesCountOnProgress is false we only send an update
|
||||
// when everything is ready.
|
||||
return;
|
||||
}
|
||||
|
||||
this._eventBus.dispatch("updatefindcontrolstate", {
|
||||
source: this,
|
||||
state,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue