Skip to content

Commit 402c2ea

Browse files
authored
Merge pull request #18 from AIVLE-School-Third-Big-Project/mergeTemp
🐛 Fix: 수정 피팅 페이지
2 parents a2ac520 + b552a54 commit 402c2ea

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

style/src/components/FittingPage/ButtonBar.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function ButtonBar({ setErrorCode, showAlert }) {
2525
const uploadmodelBg = useRef()
2626
const mouseDownEvent = useRef()
2727
const mouseUpEvent = useRef()
28+
const closeModalBtn = useRef()
2829

2930
const handleInputUrl = (e) => {
3031
setInputUrl(e.target.value)
@@ -59,10 +60,17 @@ function ButtonBar({ setErrorCode, showAlert }) {
5960
}
6061

6162
const handleModalClose = (event) => {
62-
// 모달창 바깥부분 클릭하면 모달창 닫히게 만들어줌
63+
// close 버튼 누른 경우 창 닫기
64+
if (
65+
mouseDownEvent.current === closeModalBtn.current &&
66+
mouseUpEvent.current === closeModalBtn.current
67+
) {
68+
setIsModalOpen(false)
69+
}
70+
// 모달창 바깥 클릭 시 창 닫기
6371
// 바깥 -(드래그)-> 안, 안 -(드래그)-> 밖도 꺼지지 않게 함
6472
// 위 경우도 꺼지게 하는 조건 (event.current === uploadmodelBg.current)
65-
if (
73+
else if (
6674
mouseDownEvent.current === uploadmodelBg.current &&
6775
mouseUpEvent.current === uploadmodelBg.current
6876
) {
@@ -145,7 +153,9 @@ function ButtonBar({ setErrorCode, showAlert }) {
145153
</div>
146154
<div className={styles.modalButtonContainer}>
147155
<button onClick={handleImgUploadClick}>Upload</button>
148-
<button onClick={handleModalClose}>Close</button>
156+
<button onClick={handleModalClose} ref={closeModalBtn}>
157+
Close
158+
</button>
149159
</div>
150160
</div>
151161
</div>

0 commit comments

Comments
 (0)