Fix scroll index out-of-bounds bug

This commit is contained in:
2023-09-22 16:30:45 +08:00
parent 9af0717955
commit bba86ade6d

View File

@@ -61,7 +61,7 @@ const Home: React.FC = () => {
} }
const handleScrollDown = () => { const handleScrollDown = () => {
if (currentContent >= content.length) { if (currentContent >= content.length - 1) {
return return
} }
handleScrollToContent(currentContent + 1)() handleScrollToContent(currentContent + 1)()
@@ -72,7 +72,7 @@ const Home: React.FC = () => {
} }
const handleWheel = (event: React.WheelEvent) => { const handleWheel = (event: React.WheelEvent) => {
if (event.altKey || event.ctrlKey) { if (event.altKey || event.ctrlKey || event.shiftKey) {
return return
} }