Skip to content

Comments

Fix/my profile list - 무한스크롤 시 스크롤 튐 현상 개선 (ReviewList, WineList), 로딩중에 데이터 없음 띄우지 않게 수정 + 챗봇 z-index 낮춤#138

Merged
youdaeng2 merged 4 commits intocodeit-part3-7:devfrom
youdaeng2:fix/my-profile-list
Aug 3, 2025

Conversation

@youdaeng2
Copy link
Member

📦 Pull Request

📝 요약(Summary)

  • 챗봇 z-index 강제로 50 설정 (로딩 오버레이보다 낮게)
  • 리스트 로딩 끝나고 데이터 없을 때만 MyPageEmpty 컴포넌트가 보이게 수정

ReviewList.tsx/ WineList.tsx 무한스크롤 스크롤 튐 현상

  • 무한스크롤 구조에서 createdAt 최신순 정렬 시, 데이터 prepend로 인해 스크롤이 튀는 문제 해결
  • window.scrollY를 저장 → 데이터 fetch 완료 후 scroll 위치 복원
  • 적용 방식
const prevScrollY = useRef(0);

useEffect(() => {
  if (isFetchingNextPage) {
    prevScrollY.current = window.scrollY;
  }
}, [isFetchingNextPage]);

useEffect(() => {
  if (!isFetchingNextPage) {
    requestAnimationFrame(() => {
      window.scrollTo({ top: prevScrollY.current, behavior: 'instant' });
    });
  }
}, [data?.pages.length]);

💬 공유사항 to 리뷰어

🗂️ 관련 이슈

📸 스크린샷

✅ 체크리스트

  • 빌드 및 테스트 통과
  • ESLint/Prettier 검사 통과

@vercel
Copy link

vercel bot commented Aug 3, 2025

@youdaeng2 is attempting to deploy a commit to the 626-ju's projects Team on Vercel.

A member of the Team first needs to authorize it.

@youdaeng2 youdaeng2 merged commit 2a7d720 into codeit-part3-7:dev Aug 3, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants