1
0
forked from baron/baron-sso

fix(adminfront): fix double-click required for file input in bulk upload modal

Refactored the file input button to use a native HTML label with Radix UI's asChild prop. This ensures the file dialog opens reliably on the first click without relying on JS synthetic click events.
This commit is contained in:
2026-05-20 13:30:29 +09:00
parent 11d535f4e3
commit f4bfa7c129

View File

@@ -416,20 +416,23 @@ export function UserBulkUploadModal({
"템플릿 다운로드", "템플릿 다운로드",
)} )}
</Button> </Button>
<input <Button asChild variant="secondary" className="cursor-pointer">
type="file" <label>
accept=".csv" {file
className="hidden" ? t("ui.common.change_file", "파일 변경")
ref={fileInputRef} : t("ui.common.select_file", "파일 선택")}
onChange={handleFileChange} <input
/> type="file"
<Button accept=".csv"
onClick={() => fileInputRef.current?.click()} className="hidden"
variant="secondary" ref={fileInputRef}
> onChange={handleFileChange}
{file onClick={(e) => {
? t("ui.common.change_file", "파일 변경") // Allow picking the same file again if it was cleared
: t("ui.common.select_file", "파일 선택")} (e.target as HTMLInputElement).value = "";
}}
/>
</label>
</Button> </Button>
</div> </div>