Skip to content

Fix scrolling to top when navigating to links in scrollmode #329

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

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

chrfalch
Copy link
Contributor

To make scrolling to locations in lists like footnotes etc the scrollToRect method now places the target element as the topmost element when scrolling.

Fixes Navigator places locator with anchor in the middle of the screen in scroll mode #328

To make scrolling to locations in lists like footnotes etc the scrollToRect method now places the target element as the topmost element when scrolling.

Fixes Navigator places locator with anchor in the middle of the screen in scroll mode readium#328
Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @chrfalch 👌

Note that this could be weird with highlights, ideally we want to center them. However it looks like an usability issue when jumping to a toc item or a link, as you have to find the destination on the page. So for now let's use this strategy, but come up later with an API solution to send additional options to the go() method to state if we prefer to center the destination vertically or not, and let the app decides on a case-by-case basis.

@mickael-menu mickael-menu force-pushed the fix/328-scroll-to-top branch from 78e6c0b to a01dbc7 Compare August 24, 2023 11:45
@mickael-menu mickael-menu temporarily deployed to LCP August 24, 2023 11:45 — with GitHub Actions Inactive
@mickael-menu mickael-menu temporarily deployed to LCP August 24, 2023 11:45 — with GitHub Actions Inactive
@mickael-menu mickael-menu merged commit 12aff90 into readium:develop Aug 24, 2023
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

Successfully merging this pull request may close these issues.

Navigator places locator with anchor in the middle of the screen in scroll mode
2 participants