[Trouble Shooting] 모달 드래그 시 꺼지지 않도록 처리
#296
sgoldenbird
started this conversation in
Trouble Shooting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🐞 문제 상황 (Problem Description)
모달 내부를 드래그하는 중에 마우스가 바깥으로 벗어나면
의도하지 않았음에도 모달 외부 클릭으로 인식되어 모달이 닫히는 문제가 발생했다.
특히 모바일이나 터치 기반 환경에서 실수로 닫히는 사례가 잦았고, UX를 해치는 요소로 작용했다.
💻 환경 정보 (Environment)
🔍 발생 원인 분석 (Investigation)
onMouseUp이벤트 시점에서e.target === e.currentTarget조건으로 backdrop 클릭 여부를 판단하고 있었음🛠 시도해본 해결 방법 (Attempts)
isDragging = false)isDragging = true)✅ 최종 해결 방법 (Final Solution)
useState로isDragging상태를 관리하여isDragging을false로 초기화true로 설정e.target === e.currentTarget인 경우만onClose()호출💡 알게 된 점 (Lessons Learned)
Beta Was this translation helpful? Give feedback.
All reactions