-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#7925: added cursor position management during a search #19477
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, but unfortunately this won't work as-is; see the inline comments.
As implemented, it seems that the caret isn't moved until the findbar is closed however there's no guarantee (especially in Firefox) that that ever happens.
Also, ideally this patch should include integration-tests.
Finally, please take a look at the commit history of the project to see how we usually write/format commit messages. (And please make sure to fix any spelling errors in the commit message.)
@@ -103,7 +103,7 @@ const defaultOptions = { | |||
}, | |||
supportsCaretBrowsingMode: { | |||
/** @type {boolean} */ | |||
value: false, | |||
value: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this won't work in the built-in Firefox PDF Viewer since it doesn't use the web/pdf_find_bar.js
file.
Probably the code would need to live in the https://github.com/mozilla/pdf.js/blob/master/web/caret_browsing.js file instead, and it's probably possible to re-use existing methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked in Firefox with a normal web page and whatever the caret browsing mode is, when dismissing the find bar the found text is selected.
In Chrome (with pdfium) the caret isn't moved to the last found string but in Acrobat the caret is positioned at the end of the string.
So I guess having the same behavior as in Acrobat isn't that bad, whatever the caret browsing mode is.
This feature allows to put the cursor at the search location with caret mode (see issue #7925 )