ArtifexSoftware / mupdf.js

JavaScript bindings for MuPDF
https://mupdfjs.readthedocs.io
GNU Affero General Public License v3.0
318 stars 17 forks source link

simple-viewer search always skips results from the current page #78

Closed xybei closed 1 month ago

xybei commented 2 months ago

The search function of simple-viewer has some minor flaws.

When I type in the search panel and click Next for the first time, the search results on the current page are always skipped and the results on the next page are displayed directly.

It is expected that the search results on the current page should be displayed first, and when Next is clicked again, the results on the next page will be displayed.

jamie-lemon commented 2 months ago

@mipo1357 Can you take a look into this?

mipo1357 commented 1 month ago

I will look into it.

xybei commented 1 week ago

Hi! @mipo1357 This fix does not seem to be very friendly to Chinese characters. When I input and search for Chinese, I need to type several letters "zhong" to enter the Chinese character "中" (for example, it appears on the first page), but when I type the first letter "z" (it appears on the fifth page), the inputevent will be triggered and the search will be started, the view will jump to the fifth page. Even if I enter the complete character "中" later, the character "中" on the first page has been skipped.