Skip to content

Conversation

@KIMGEONHWI
Copy link
Collaborator

@KIMGEONHWI KIMGEONHWI commented Dec 2, 2025

📌 Related Issues

✅ 체크 리스트

  • PR 제목의 형식을 잘 작성했나요? e.g. [Feat] PR 템플릿 작성
  • 빌드가 성공했나요? (pnpm build)
  • 리뷰어와 라벨을 지정했나요?

📄 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)배포 환경에서 테스트 필요

@KIMGEONHWI KIMGEONHWI linked an issue Dec 2, 2025 that may be closed by this pull request
@KIMGEONHWI KIMGEONHWI self-assigned this Dec 2, 2025
@KIMGEONHWI KIMGEONHWI added 🔧 Fix 버그 수정 건휘 Pull it back, that siren labels Dec 2, 2025
@KIMGEONHWI KIMGEONHWI changed the title fix: 아이폰 스와이프 뒤로가기시 모달 중첩 이슈 해결 [Fix] 아이폰 스와이프 뒤로가기 모달 중첩 이슈 해결 Dec 2, 2025
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

✅ Storybook 배포 완료! 🔗 https://67e4fd1fd2c7078dceec04a4-bnifwjqcny.chromatic.com/

Copy link
Collaborator

@heesunee heesunee left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Comment on lines +92 to +95
onClose={() => {
isModalOpenRef.current = false;
close();
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

중복되는 부분이 많은것 같은데 handle~ 로 따로 뺴서 넣는거 어떨까요 ?!

Copy link
Member

@constantly-dev constantly-dev left a comment

Choose a reason for hiding this comment

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

해당 훅은 한번 싹 리팩토링 하면 좋을 것 같아요!! 역할이 많은 느낌이어서 분리하면 좋을 것 같습니다! 수고하셨습니다~

Copy link
Member

Choose a reason for hiding this comment

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

image

이전에는 발견을 못했는데 맨 아래 useEffect에 있는 event.returnValue 이거 deprecated된 것 같아요!

Copy link
Member

@hansoojeongsj hansoojeongsj left a comment

Choose a reason for hiding this comment

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

아자자

@KIMGEONHWI
Copy link
Collaborator Author

해당 훅은 한번 싹 리팩토링 하면 좋을 것 같아요!! 역할이 많은 느낌이어서 분리하면 좋을 것 같습니다! 수고하셨습니다~

동의합니다! 감사합니다

@KIMGEONHWI KIMGEONHWI merged commit c0065cb into develop Dec 2, 2025
8 checks passed
@KIMGEONHWI KIMGEONHWI deleted the fix/#623/iphone-modal-fix branch December 2, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

건휘 Pull it back, that siren 🔧 Fix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 아이폰 스와이프 뒤로가기 모달 중첩 이슈 해결

5 participants