Skip to content

Commit d7ef3cb

Browse files
committed
Upload file not removed properly when on file delete from UI
1 parent 2218eef commit d7ef3cb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Radzen.Blazor/RadzenUpload.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public async System.Threading.Tasks.Task RemoveFile(string fileName, bool ignore
324324
protected async System.Threading.Tasks.Task OnRemove(PreviewFileInfo file, bool fireChangeEvent = true)
325325
{
326326
files.Remove(file);
327-
await JSRuntime.InvokeVoidAsync("Radzen.removeFileFromUpload", Reference, file.Name, Name ?? GetId());
327+
await JSRuntime.InvokeVoidAsync("Radzen.removeFileFromUpload", file.Name, Name ?? GetId());
328328
if (fireChangeEvent) await Change.InvokeAsync(CreateUploadChangeEventArgs(files));
329329
}
330330

Radzen.Blazor/wwwroot/Radzen.Blazor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ window.Radzen = {
838838
}
839839
}
840840
},
841-
removeFileFromUpload: function (ref, name, id) {
842-
var uploadComponent = Radzen.uploadComponents && Radzen.uploadComponents[ref];
841+
removeFileFromUpload: function (name, id) {
842+
var uploadComponent = Radzen.uploadComponents && Radzen.uploadComponents[id];
843843
if (!uploadComponent) return;
844844
var file = uploadComponent.files.find(function (f) { return f.name == name; })
845845
if (!file) { return; }

0 commit comments

Comments
 (0)