Skip to content

Commit 7d21718

Browse files
committed
fix(image): allow re-uploading same image file
Fixes #543, #568, #503 When using base64 image upload (no uploadUrl), the file input value was not reset after upload, preventing the same image from being re-uploaded without first uploading a different image. Changes: - Reset event.target.value after FileReader completes - Matches existing behavior in watchUploadImage for URL uploads - Users can now delete and re-upload the same image immediately Regression from issue #38 fix that was accidentally removed.
1 parent 3563552 commit 7d21718

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

projects/angular-editor/src/lib/ae-toolbar/ae-toolbar.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ export class AeToolbarComponent {
334334
reader.onload = (e: ProgressEvent) => {
335335
const fr = e.currentTarget as FileReader;
336336
this.editorService.insertImage(fr.result.toString());
337+
// Reset input value to allow re-uploading the same file
338+
event.target.value = null;
337339
};
338340
reader.readAsDataURL(file);
339341
}

0 commit comments

Comments
 (0)