Skip to content

fix: properly scroll vertical text #656

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 12 commits into from
May 20, 2025
Prev Previous commit
Next Next commit
fix regression for vertical ltr
  • Loading branch information
shovel-kun committed May 16, 2025
commit da3ad4f412fb87afa38c605ebe754db5f38ccf74
4 changes: 2 additions & 2 deletions readium/navigator/src/main/assets/_scripts/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function scrollToStart() {
if (isScrollModeEnabled() && !isVerticalWritingMode()) {
document.scrollingElement.scrollTop = 0;
} else {
document.scrollingElement.scrollLeft = 0;
document.scrollingElement.scrollLeft = isRTL() ? 0 : -document.body.scrollWidth;
}
}

Expand All @@ -175,7 +175,7 @@ export function scrollToEnd() {

if (isScrollModeEnabled()) {
if (isVerticalWritingMode()) {
scrollingElement.scrollLeft = -document.body.scrollWidth;
scrollingElement.scrollLeft = isRTL() ? 0 : document.body.scrollWidth;
} else {
scrollingElement.scrollTop = document.body.scrollHeight;
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.