Skip to content

Conversation

@ddumini
Copy link
Collaborator

@ddumini ddumini commented Apr 30, 2025

랜딩 페이지 하단에서 리스트로 이동했을 때 페이지 하단으로 이동하는 이슈 해결 Resolves: #184

📝 Summary

랜딩 페이지 하단에서 리스트로 이동했을 때 페이지 하단으로 이동하는 이슈 해결

🔧 Changes

  • ScrollTop.jsx 훅을 만들어서 App.jsx Route내부에 페이지가 이동할 때 (path가 변경될 때)마다 페이지 상단으로 이동하게 작업하였습니다.

✅ Checklist

  • 컨벤션을 준수하였습니다.
  • 변경 사항을 테스트하였습니다.
  • 설명을 충분히 작성하였습니다.
  • 올바른 브랜치에 PR을 보냈습니다.
  • 🤞 리뷰어의 마음을 사로잡았습니다.

🚀 Test Plan

  • 랜딩페이지 하단에 있는 버튼 링크로 이동해보세요.

📚 Additional

  • 아마도 이 PR은 다크호스일지도... 🎩✨
  • 동환님 영상 작업하신거 보고 엇! 싶어서 찾아봤더니
  • 싱글 페이지 애플리케이션(SPA)에서 흔히 발생하는 문제라고 하네요

🚨 "모든 PR에는 커피가 필요하다!"

랜딩 페이지 하단에서 리스트로 이동했을 때 페이지 하단으로 이동하는 이슈 해결 Resolves: #184
@ddumini ddumini added this to the UI Polish milestone Apr 30, 2025
@ddumini ddumini self-assigned this Apr 30, 2025
@ddumini ddumini changed the base branch from main to develop April 30, 2025 02:20
@Seon-K
Copy link
Collaborator

Seon-K commented Apr 30, 2025

이런 디테일은 또 언제 확인하신거죠 ?!
저도 의문이긴 했는데 이런 방법으로 해결이 가능했군요!
수고하셨습니다 👍 👍

Copy link
Contributor

@two678 two678 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다! 어째 계속해서 에러가 나오네용..


useEffect(() => {
if (pathname) {
window.scrollTo(0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 이슈가 있었군요... 스크롤을 초기화해주는 코드인가용?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

페이지가 이동할 때 (path가 변경될 때)마다 페이지 상단으로 이동하게 해주는 코드입니당~

@two678 two678 merged commit c45e5a9 into develop Apr 30, 2025
1 check passed
@ddumini ddumini deleted the fix/list-scroll-position-reset branch April 30, 2025 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[랜딩 페이지 하단에서 리스트로 이동했을 때 페이지 하단으로 이동하는 이슈]

4 participants