Skip to content
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

Anchor link behavior causing automatic scroll to top of PDF.js iframe when search query params absent #2348

Open
st1072 opened this issue Sep 27, 2024 · 0 comments

Comments

@st1072
Copy link

st1072 commented Sep 27, 2024

Descriptive summary

On Hyku v5.1.0, Chrome and other browsers automatically jump to the top of PDF.js iframe when the iframe src includes a trailing "#" (indicating an anchor link).

Screenshot 2024-09-27 at 4 08 07 PM

This "#" should only be included if search query parameters exist.

Fix applied to pdf_js_helper.rb here:
https://github.com/Georgetown-University-Libraries/GU-Hyku/commit/0c650b503e6eafb2da80986a89a0b2dc365003bf

Rationale

Automatically jumping to the top of the PDF.js iframe skips masthead, navigation, work title and other content which the user may want to see first. Also, this behavior is inconsistent with the behavior of work show pages that do not contain PDF.js iframes.

Expected behavior

Chrome and other browsers render top of HTML document in viewport after loading pages with PDF.js iframes.

Actual behavior

Chrome and other browsers automatically jump to top of PDF.js iframes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant