Skip to content

Commit

Permalink
Scroll to top when navigating to locators in scroll mode (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrfalch authored Aug 28, 2023
1 parent 85ccb5b commit af78d31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions readium/navigator/src/main/assets/_scripts/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ function scrollToRange(range) {

function scrollToRect(rect) {
if (isScrollModeEnabled()) {
document.scrollingElement.scrollTop =
rect.top + window.scrollY - window.innerHeight / 2;
document.scrollingElement.scrollTop = rect.top + window.scrollY;
} else {
document.scrollingElement.scrollLeft = snapOffset(
rect.left + window.scrollX
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit af78d31

Please sign in to comment.