Scrolling Enhancements (#2417)

This commit is contained in:
Joe Milazzo 2023-11-08 16:11:50 -06:00 committed by GitHub
parent 8875bc3585
commit f4e8daf983
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 51 additions and 71 deletions

View file

@ -271,13 +271,20 @@ export class DownloadService {
}
private save(blob: Blob, filename: string) {
const saveLink = document.createElement( 'a' );
if (saveLink.href) {
URL.revokeObjectURL(saveLink.href);
}
saveLink.href = URL.createObjectURL(blob);
const saveLink = document.createElement('a');
saveLink.style.display = 'none';
document.body.appendChild(saveLink);
const url = URL.createObjectURL(blob);
saveLink.href = url;
saveLink.download = filename;
saveLink.dispatchEvent( new MouseEvent( 'click' ) );
// Trigger the click event
saveLink.click();
// Cleanup
URL.revokeObjectURL(url);
document.body.removeChild(saveLink);
}
}