Skip to content

Commit

Permalink
fix : home으로 탭 이동시 , 스크롤 안되는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Happhee committed Oct 18, 2024
1 parent b2bdf8d commit 2d4e30e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/common/LayoutWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { ReactNode, useEffect, useRef, useState } from 'react';
import { Header, Footer, FloatingButton } from 'components/common';
import { useRouter } from 'next/router';
import { FloatingButton, Footer, Header } from 'components/common';
import { IntroSection } from 'components/home';
import PATH from 'constants/path';
import { useRouter } from 'next/router';
import { ReactNode, useEffect, useRef } from 'react';
import smoothscroll from 'smoothscroll-polyfill'; // Safari 에서 smooth 효과 적용

interface LayoutWrapperProps {
Expand Down Expand Up @@ -51,8 +51,10 @@ function LayoutWrapper({ children }: LayoutWrapperProps) {
};

outerRefCurrent.addEventListener('wheel', wheelAnimationHandler);
return () =>
return () => {
outerRefCurrent.removeEventListener('wheel', wheelAnimationHandler);
scrollEventRef.current = false;
};
}
}, [asPath]);

Expand Down

0 comments on commit 2d4e30e

Please sign in to comment.