fix: 파일 선택을 취소하면 모달이 닫히던 문제
``은 파일 선택 창을 닫을 때 cancel 이벤트를 **버블링**으로 낸다. FoxModal이 `
@6d9cbcf502ddd1230d8dee1d80a0fcb6591bd0ac
--- @fox/core/components/fox-modal/fox-modal.tsx
+++ @fox/core/components/fox-modal/fox-modal.tsx
... | ... | @@ -73,6 +73,10 @@ |
| 73 | 73 |
className={cx("fox-modal", `fox-modal--${size}`, className)}
|
| 74 | 74 |
// Esc는 브라우저가 닫아 버리므로 막고, 닫을지는 호출부가 정하게 한다. |
| 75 | 75 |
onCancel={(event) => {
|
| 76 |
+ // 파일 선택 취소도 cancel을 버블링시킨다 — 대상이 dialog일 때만 닫기로 본다. |
|
| 77 |
+ if (event.target !== event.currentTarget) {
|
|
| 78 |
+ return; |
|
| 79 |
+ } |
|
| 76 | 80 |
event.preventDefault(); |
| 77 | 81 |
onClose(); |
| 78 | 82 |
}} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?