Skip to content

Commit b4a6398

Browse files
committed
fix: add back the body.appendChild(a) in download util
1 parent ae8e1b1 commit b4a6398

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/utils/download.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ export function downloadFileLink(link: string, filename: string) {
1414
const a = document.createElement('a')
1515
a.href = link
1616
a.download = filename
17-
a.click()
17+
document.body.appendChild(a)
18+
19+
try {
20+
a.click()
21+
} finally {
22+
document.body.removeChild(a)
23+
}
1824
}
1925

2026
/**

0 commit comments

Comments
 (0)