디자인디테일

This commit is contained in:
koreacomp5
2025-11-01 23:16:22 +09:00
parent f84111b9cc
commit 27cf98eef2
20 changed files with 735 additions and 384 deletions

View File

@@ -79,7 +79,8 @@ export function UploadButton({ onUploaded, multiple = false, maxWidth = 1600, ma
const { show } = useToast();
const [loading, setLoading] = useState(false);
async function onChange(e: React.ChangeEvent<HTMLInputElement>) {
const files = Array.from(e.target.files ?? []);
const input = e.currentTarget; // React 이벤트 풀링 대비: 참조 보관
const files = Array.from(input.files ?? []);
if (files.length === 0) return;
try {
setLoading(true);
@@ -99,7 +100,8 @@ export function UploadButton({ onUploaded, multiple = false, maxWidth = 1600, ma
show("업로드 실패");
} finally {
setLoading(false);
e.currentTarget.value = "";
// 선택값 초기화(같은 파일 재선택 가능하도록)
if (input) input.value = "";
}
}
return <label style={{ display: "inline-block" }}>