-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Cannot switch between annotation layer form fields on Safari (macOS/iOS) #13191
Comments
WFM, using PDF.js version
If this is specific to Safari, that'd suggest a bug in the browser itself rather than the PDF.js library. For anyone trying to debug/fix this, please keep in mind that we'll generally not accept browser-specific compatibility hacks placed in the main code-base and such things should usually live in https://github.com/mozilla/pdf.js/blob/master/src/shared/compatibility.js |
This is specific to Safari - to which there is no alternative on iOS (tablets, phones). |
|
|
|
This looks, for all intents and purposes, like a duplicate of #12592. |
This causes issues on Safari (see mozilla#12592 and mozilla#13191). Just removing the line fixes the issues and no difference / regression in behavior was observed without the `event.target.setSelection(0, 0);` bit in other browsers (including Firefox). The blur (switching focus out of the control) does effectively achieve the same thing in all browsers I have tested on. Tested specifically in Firefox with 1. inspect a `TextWidgetAnnotation` `input` element 2. `$0.setSelectionRange = (a, b) => console.warn(a, b);` 3. type `wow` and select `wow` in the input element 4. click/tab/tap outside the input element 5. <kbd>CTRL</kbd> + <kbd>C</kbd> ➡ no `wow` ✔ copied 6. <kbd>CTRL</kbd> + <kbd>V</kbd> ➡ confirmed
setSelectionRange(0, 0); // required only by Firefox, causes issues in Safari (see mozilla#12592 and mozilla#13191). scrollLeft = 0; // is a fix that breaks the focus trap in Safari while keeping Firefox behavior same.
setSelectionRange(0, 0); // required only by Firefox, causes issues in Safari (see mozilla#12592 and mozilla#13191). scrollLeft = 0; // is a fix that breaks the focus trap in Safari while keeping Firefox behavior same for mozilla#12359
`setSelectionRange(0, 0)` added in mozilla@44b24fc for mozilla#12359, required only by Firefox ([bug](https://bugzilla.mozilla.org/show_bug.cgi?id=860329)), causes issues mozilla#13191, mozilla#12592 in Safari. `scrollLeft = 0` is a fix that breaks the focus trap in Safari while **keeping Firefox behavior same for mozilla#12359**.
`setSelectionRange(0, 0)` added in mozilla@44b24fc for mozilla#12359, required only by Firefox ([bug](https://bugzilla.mozilla.org/show_bug.cgi?id=860329)), causes issues mozilla#13191, mozilla#12592 in Safari. `scrollLeft = 0` is a fix that breaks the focus trap in Safari while **keeping Firefox behavior same for mozilla#12359**.
Attach (recommended) or Link to PDF file here: OoPdfFormExample.pdf
Configuration:
(the issue persists in latest versions of Safari on iOS as well)
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
Focus switches to the field from step 3
What went wrong? (add screenshot)
Focus stays stuck in the Given Name field.
Tab button does not work either.
The text was updated successfully, but these errors were encountered: