fix: don't hide horizontal scrollbar at the bottom, closes #515 (#533)

This commit is contained in:
Huang Xin
2025-03-08 21:26:10 +08:00
committed by GitHub
parent f841004e7a
commit 89f1c43984
2 changed files with 7 additions and 3 deletions
@@ -79,6 +79,7 @@ const FooterBar: React.FC<FooterBarProps> = ({
appService?.hasRoundedWindow && 'rounded-window-bottom-right',
!isSideBarVisible && appService?.hasRoundedWindow && 'rounded-window-bottom-left',
isHoveredAnim && 'hover-bar-anim',
viewSettings?.vertical && viewSettings?.scrolled ? 'mb-3 !h-6' : '',
hoveredBookKey === bookKey ? `opacity-100` : `opacity-0`,
)}
dir={viewSettings?.rtl ? 'rtl' : 'ltr'}
@@ -58,12 +58,15 @@ export const useClickEvent = (
}
}
}
} else if (msg.data.type === 'iframe-wheel' && !viewSettings.scrolled) {
} else if (msg.data.type === 'iframe-wheel') {
const { deltaY } = msg.data;
const fontSize = viewSettings?.defaultFontSize ?? 16;
const lineHeight = viewSettings?.lineHeight ?? 1.6;
const distance = fontSize * lineHeight * 3;
if (deltaY > 0) {
viewRef.current?.next(1);
viewRef.current?.next(viewSettings.scrolled ? distance : 1);
} else if (deltaY < 0) {
viewRef.current?.prev(1);
viewRef.current?.prev(viewSettings.scrolled ? distance : 1);
}
} else if (msg.data.type === 'iframe-mouseup') {
if (msg.data.button === 3) {