Fix reader progress bar current page slot positioning for single page chapters

Was only noticeable in the mobile reader ui because the desktop one hides this component and uses its own logic.
It resulted in the previous/next button not being clickable because the current page component was overlaying it
This commit is contained in:
schroda
2026-04-13 17:59:14 +02:00
parent 684c9c3733
commit 9595076dae
2 changed files with 5 additions and 4 deletions

View File

@@ -37,14 +37,14 @@ export const ReaderProgressBarCurrentPageSlot = ({
position: 'absolute',
cursor: isDragging ? 'grabbing' : 'grab',
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isHorizontal, {
left: `${(Math.max(0, currentPagesIndex - 1) / (pagesLength - 1)) * 100}%`,
width: `calc(100% / ${pagesLength - 1})`,
left: `${(Math.max(0, currentPagesIndex - 1) / pagesLength) * 100}%`,
width: `calc(100% / ${pagesLength})`,
height: '100%',
}),
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isVertical, {
top: `${(Math.max(0, currentPagesIndex - 1) / (pagesLength - 1)) * 100}%`,
top: `${(Math.max(0, currentPagesIndex - 1) / pagesLength) * 100}%`,
width: '100%',
height: `calc(100% / ${pagesLength - 1})`,
height: `calc(100% / ${pagesLength})`,
}),
...boxProps?.sx,
}}