OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#46010] reset file input after selecting a file
Eric Schubert56c3cd6a397e
diff --git a/frontend/src/app/shared/components/attachments/attachments.component.ts b/frontend/src/app/shared/components/attachments/attachments.component.tsindex ff2795edd81..b191e3aaffa 100644--- a/frontend/src/app/shared/components/attachments/attachments.component.ts+++ b/frontend/src/app/shared/components/attachments/attachments.component.ts@@ -198,6 +198,8 @@ export class OpAttachmentsComponent extends UntilDestroyedMixin implements OnIniconst files:UploadFile[] = Array.from(fileList);this.uploadFiles(files);+ // reset file input, so that selecting the same file again triggers a change+ this.filePicker.nativeElement.value = '';}public onDropFiles(event:DragEvent):void {diff --git a/frontend/src/app/shared/components/storages/storage/storage.component.ts b/frontend/src/app/shared/components/storages/storage/storage.component.tsindex 0c0658f7e72..410fc45140a 100644--- a/frontend/src/app/shared/components/storages/storage/storage.component.ts+++ b/frontend/src/app/shared/components/storages/storage/storage.component.ts@@ -261,10 +261,12 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnDconst fileList = this.filePicker.nativeElement.files;if (fileList === null) return;- this.openSelectLocationDialog(fileList);+ this.openSelectLocationDialog(fileList[0]);+ // reset file input, so that selecting the same file again triggers a change+ this.filePicker.nativeElement.value = '';}- private openSelectLocationDialog(files:FileList|null):void {+ private openSelectLocationDialog(file:File):void {const locals = {storageType: this.storage._links.type.href,storageName: this.storage.name,@@ -273,8 +275,8 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnDthis.opModalService.show<LocationPickerModalComponent>(LocationPickerModalComponent, 'global', locals).subscribe((m) => {m.closingEvent.subscribe((modal) => {- if (modal.submitted && files !== null) {- this.uploadFile(files[0], modal.location);+ if (modal.submitted) {+ this.uploadFile(file, modal.location);}});});@@ -483,7 +485,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnDreturn;}- this.openSelectLocationDialog(files);+ this.openSelectLocationDialog(files[0]);}public onDragOver(event:DragEvent):void {