-
Notifications
You must be signed in to change notification settings - Fork 2
[Fix] 아이폰 스와이프 뒤로가기 모달 중첩 이슈 해결 #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
✅ Storybook 배포 완료! 🔗 https://67e4fd1fd2c7078dceec04a4-bnifwjqcny.chromatic.com/ |
heesunee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
| onClose={() => { | ||
| isModalOpenRef.current = false; | ||
| close(); | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중복되는 부분이 많은것 같은데 handle~ 로 따로 뺴서 넣는거 어떨까요 ?!
constantly-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 훅은 한번 싹 리팩토링 하면 좋을 것 같아요!! 역할이 많은 느낌이어서 분리하면 좋을 것 같습니다! 수고하셨습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hansoojeongsj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아자자
동의합니다! 감사합니다 |

📌 Related Issues
✅ 체크 리스트
📄 Tasks
Modal 열림 상태 추적: isModalOpenRef ref를 추가해 Modal이 열려있는지 추적
중복 방지 로직 추가:
handlePopState에서Modal이 이미 열려있으면 새로운Modal을 열지 않고history.pushState만 수행.헤더 네비게이션 클릭 핸들러에도 동일한 로직을 적용했습니다.
상태 리셋: Modal이 닫힐 때 (onClose, onLeftClickHandler, onRightClickHandler) isModalOpenRef.current를 false로 리셋.
아이폰에서 스와이프로 뒤로가기할 때
popstate이벤트가 연속 발생해도Modal이 중첩되지 않습니다.Modal이 이미 열려있으면 추가로 열지 않고, 닫힌 후에만 다시 열 수 있습니다.⭐ PR Point
📷 Screenshot
🔔 ETC
cf)배포 환경에서 테스트 필요