Skip to content

Commit

Permalink
implement mouse scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Kloc committed Apr 23, 2024
1 parent e4125c9 commit af79ee7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ function App(): JSX.Element {
useEffect(() => {
if (!isMobile) {
const handleWheel = (e: WheelEvent) => {
const target = e.target as HTMLElement;
const isTargetTable = target.closest(".table-container") !== null;
const isLastSlide = activeIndex === 4;

if (isTargetTable && isLastSlide) {
return;
}

if (!isScrolling) {
setIsScrolling(true);
let nextIndex = activeIndex;
Expand Down

0 comments on commit af79ee7

Please sign in to comment.