File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
style/src/components/FittingPage Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments